MLIR  14.0.0git
Static Public Member Functions | List of all members
mlir::detail::TypeUniquer Struct Reference

A utility class to get, or create, unique instances of types within an MLIRContext. More...

#include "mlir/IR/TypeSupport.h"

Static Public Member Functions

template<typename T , typename... Args>
static std::enable_if_t< !std::is_same< typename T::ImplType, TypeStorage >::value, T > get (MLIRContext *ctx, Args &&...args)
 Get an uniqued instance of a parametric type T. More...
 
template<typename T >
static std::enable_if_t< std::is_same< typename T::ImplType, TypeStorage >::value, T > get (MLIRContext *ctx)
 Get an uniqued instance of a singleton type T. More...
 
template<typename T , typename... Args>
static LogicalResult mutate (MLIRContext *ctx, typename T::ImplType *impl, Args &&...args)
 Change the mutable component of the given type instance in the provided context. More...
 
template<typename T >
static std::enable_if_t< !std::is_same< typename T::ImplType, TypeStorage >::valueregisterType (MLIRContext *ctx)
 Register a parametric type instance T with the uniquer. More...
 
template<typename T >
static std::enable_if_t< std::is_same< typename T::ImplType, TypeStorage >::valueregisterType (MLIRContext *ctx)
 Register a singleton type instance T with the uniquer. More...
 

Detailed Description

A utility class to get, or create, unique instances of types within an MLIRContext.

This class manages all creation and uniquing of types.

Definition at line 165 of file TypeSupport.h.

Member Function Documentation

◆ get() [1/2]

template<typename T , typename... Args>
static std::enable_if_t< !std::is_same<typename T::ImplType, TypeStorage>::value, T> mlir::detail::TypeUniquer::get ( MLIRContext ctx,
Args &&...  args 
)
inlinestatic

◆ get() [2/2]

template<typename T >
static std::enable_if_t< std::is_same<typename T::ImplType, TypeStorage>::value, T> mlir::detail::TypeUniquer::get ( MLIRContext ctx)
inlinestatic

Get an uniqued instance of a singleton type T.

Definition at line 189 of file TypeSupport.h.

References mlir::StorageUniquer::get(), mlir::MLIRContext::getTypeUniquer(), and mlir::StorageUniquer::isSingletonStorageInitialized().

◆ mutate()

template<typename T , typename... Args>
static LogicalResult mlir::detail::TypeUniquer::mutate ( MLIRContext ctx,
typename T::ImplType *  impl,
Args &&...  args 
)
inlinestatic

Change the mutable component of the given type instance in the provided context.

Definition at line 204 of file TypeSupport.h.

References mlir::MLIRContext::getTypeUniquer(), and mlir::StorageUniquer::mutate().

◆ registerType() [1/2]

template<typename T >
static std::enable_if_t< !std::is_same<typename T::ImplType, TypeStorage>::value> mlir::detail::TypeUniquer::registerType ( MLIRContext ctx)
inlinestatic

Register a parametric type instance T with the uniquer.

Definition at line 215 of file TypeSupport.h.

References mlir::MLIRContext::getTypeUniquer(), and mlir::StorageUniquer::registerParametricStorageType().

◆ registerType() [2/2]

template<typename T >
static std::enable_if_t< std::is_same<typename T::ImplType, TypeStorage>::value> mlir::detail::TypeUniquer::registerType ( MLIRContext ctx)
inlinestatic

Register a singleton type instance T with the uniquer.

Definition at line 223 of file TypeSupport.h.

References mlir::MLIRContext::getTypeUniquer(), mlir::AbstractType::lookup(), and mlir::StorageUniquer::registerSingletonStorageType().


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