MLIR  20.0.0git
Public Types | Static Protected Member Functions | Protected Attributes | List of all members
mlir::TypeInterface< ConcreteType, Traits > Class Template Reference

This class represents the base of a type interface. More...

#include "mlir/IR/Types.h"

+ Inheritance diagram for mlir::TypeInterface< ConcreteType, Traits >:

Public Types

using Base = TypeInterface< ConcreteType, Traits >
 
using InterfaceBase = detail::Interface< ConcreteType, Type, Traits, Type, TypeTrait::TraitBase >
 
- Public Types inherited from mlir::detail::Interface< ConcreteType, Type, Traits, Type, TypeTrait::TraitBase >
using Concept = typename Traits::Concept
 
using Model = typename Traits::template Model< T >
 
using FallbackModel = typename Traits::template FallbackModel< T >
 
using InterfaceBase = Interface< ConcreteType, Type, Traits, Type, TypeTrait::TraitBase >
 
using ExternalModel = typename Traits::template ExternalModel< T, U >
 
using ValueType = Type
 
- Public Types inherited from mlir::Type
template<typename ConcreteType , typename BaseType , typename StorageType , template< typename T > class... Traits>
using TypeBase = detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::TypeUniquer, Traits... >
 Utility class for implementing types. More...
 
using ImplType = TypeStorage
 
using AbstractTy = AbstractType
 

Static Protected Member Functions

static InterfaceBase::ConceptgetInterfaceFor (Type type)
 Returns the impl interface instance for the given type. More...
 

Protected Attributes

friend InterfaceBase
 Allow access to 'getInterfaceFor'. More...
 
- Protected Attributes inherited from mlir::Type
ImplTypeimpl {nullptr}
 

Additional Inherited Members

- Public Member Functions inherited from mlir::detail::Interface< ConcreteType, Type, Traits, Type, TypeTrait::TraitBase >
 Interface (Type t=Type())
 Construct an interface from an instance of the value type. More...
 
 Interface (std::nullptr_t)
 
 Interface (T t)
 Construct an interface instance from a type that implements this interface's trait. More...
 
 Interface (Type t, const Concept *conceptImpl)
 Constructor for a known concept. More...
 
 Interface (Type t, std::nullptr_t)
 Constructor for DenseMapInfo's empty key and tombstone key. More...
 
- Public Member Functions inherited from mlir::Type
constexpr Type ()=default
 
 Type (const ImplType *impl)
 
 Type (const Type &other)=default
 
Typeoperator= (const Type &other)=default
 
bool operator== (Type other) const
 
bool operator!= (Type other) const
 
 operator bool () const
 
bool operator! () const
 
template<typename... Tys>
bool isa () const
 
template<typename... Tys>
bool isa_and_nonnull () const
 
template<typename U >
dyn_cast () const
 
template<typename U >
dyn_cast_or_null () const
 
template<typename U >
cast () const
 
TypeID getTypeID ()
 Return a unique identifier for the concrete type. More...
 
MLIRContextgetContext () const
 Return the MLIRContext in which this type was uniqued. More...
 
DialectgetDialect () const
 Get the dialect this type is registered to. More...
 
bool isIndex () const
 
bool isFloat8E5M2 () const
 
bool isFloat8E4M3 () const
 
bool isFloat8E4M3FN () const
 
bool isFloat8E5M2FNUZ () const
 
bool isFloat8E4M3FNUZ () const
 
bool isFloat8E4M3B11FNUZ () const
 
bool isBF16 () const
 
bool isF16 () const
 
bool isTF32 () const
 
bool isF32 () const
 
bool isF64 () const
 
bool isF80 () const
 
bool isF128 () const
 
bool isInteger () const
 Return true if this is an integer type (with the specified width). More...
 
bool isInteger (unsigned width) const
 Return true if this is an integer type with the specified width. More...
 
bool isSignlessInteger () const
 Return true if this is a signless integer type (with the specified width). More...
 
bool isSignlessInteger (unsigned width) const
 
bool isSignedInteger () const
 Return true if this is a signed integer type (with the specified width). More...
 
bool isSignedInteger (unsigned width) const
 
bool isUnsignedInteger () const
 Return true if this is an unsigned integer type (with the specified width). More...
 
bool isUnsignedInteger (unsigned width) const
 
unsigned getIntOrFloatBitWidth () const
 Return the bit width of an integer or a float type, assert failure on other types. More...
 
bool isSignlessIntOrIndex () const
 Return true if this is a signless integer or index type. More...
 
bool isSignlessIntOrIndexOrFloat () const
 Return true if this is a signless integer, index, or float type. More...
 
bool isSignlessIntOrFloat () const
 Return true of this is a signless integer or a float type. More...
 
bool isIntOrIndex () const
 Return true if this is an integer (of any signedness) or an index type. More...
 
bool isIntOrFloat () const
 Return true if this is an integer (of any signedness) or a float type. More...
 
bool isIntOrIndexOrFloat () const
 Return true if this is an integer (of any signedness), index, or float type. More...
 
void print (raw_ostream &os) const
 Print the current type. More...
 
void print (raw_ostream &os, AsmState &state) const
 
void dump () const
 
const void * getAsOpaquePointer () const
 Methods for supporting PointerLikeTypeTraits. More...
 
template<typename InterfaceT >
bool hasPromiseOrImplementsInterface ()
 Returns true if InterfaceT has been promised by the dialect or implemented. More...
 
template<template< typename T > class Trait>
bool hasTrait ()
 Returns true if the type was registered with a particular trait. More...
 
const AbstractTygetAbstractType () const
 Return the abstract type descriptor for this type. More...
 
ImplTypegetImpl () const
 Return the Type implementation. More...
 
void walkImmediateSubElements (function_ref< void(Attribute)> walkAttrsFn, function_ref< void(Type)> walkTypesFn) const
 Walk all of the immediately nested sub-attributes and sub-types. More...
 
auto replaceImmediateSubElements (ArrayRef< Attribute > replAttrs, ArrayRef< Type > replTypes) const
 Replace the immediately nested sub-attributes and sub-types with those provided. More...
 
template<WalkOrder Order = WalkOrder::PostOrder, typename... WalkFns>
auto walk (WalkFns &&...walkFns)
 Walk this type and all attibutes/types nested within using the provided walk functions. More...
 
template<typename... ReplacementFns>
auto replace (ReplacementFns &&...replacementFns)
 Recursively replace all of the nested sub-attributes and sub-types using the provided map functions. More...
 
- Static Public Member Functions inherited from mlir::detail::Interface< ConcreteType, Type, Traits, Type, TypeTrait::TraitBase >
static bool classof (Type t)
 Support 'classof' by checking if the given object defines the concrete interface. More...
 
static TypeID getInterfaceID ()
 Define an accessor for the ID of this interface. More...
 
- Static Public Member Functions inherited from mlir::Type
static Type getFromOpaquePointer (const void *pointer)
 
- Protected Member Functions inherited from mlir::detail::Interface< ConcreteType, Type, Traits, Type, TypeTrait::TraitBase >
const ConceptgetImpl () const
 Get the raw concept in the correct derived concept type. More...
 
ConceptgetImpl ()
 

Detailed Description

template<typename ConcreteType, typename Traits>
class mlir::TypeInterface< ConcreteType, Traits >

This class represents the base of a type interface.

See the definition of detail::Interface for requirements on the Traits type.

Definition at line 278 of file Types.h.

Member Typedef Documentation

◆ Base

template<typename ConcreteType , typename Traits >
using mlir::TypeInterface< ConcreteType, Traits >::Base = TypeInterface<ConcreteType, Traits>

Definition at line 281 of file Types.h.

◆ InterfaceBase

template<typename ConcreteType , typename Traits >
using mlir::TypeInterface< ConcreteType, Traits >::InterfaceBase = detail::Interface<ConcreteType, Type, Traits, Type, TypeTrait::TraitBase>

Definition at line 282 of file Types.h.

Member Function Documentation

◆ getInterfaceFor()

template<typename ConcreteType , typename Traits >
static InterfaceBase::Concept* mlir::TypeInterface< ConcreteType, Traits >::getInterfaceFor ( Type  type)
inlinestaticprotected

Member Data Documentation

◆ InterfaceBase

template<typename ConcreteType , typename Traits >
friend mlir::TypeInterface< ConcreteType, Traits >::InterfaceBase
protected

Allow access to 'getInterfaceFor'.

Definition at line 301 of file Types.h.


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