MLIR  20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
mlir::AsmDialectResourceHandleBase< DerivedT, ResourceT, DialectT > Class Template Reference

This class represents a CRTP base class for dialect resource handles. More...

#include "mlir/IR/OpImplementation.h"

+ Inheritance diagram for mlir::AsmDialectResourceHandleBase< DerivedT, ResourceT, DialectT >:

Public Types

using Dialect = DialectT
 

Public Member Functions

 AsmDialectResourceHandleBase (ResourceT *resource, DialectT *dialect)
 Construct a handle from a pointer to the resource. More...
 
 AsmDialectResourceHandleBase (AsmDialectResourceHandle handle)
 
ResourceT * getResource ()
 Return the resource referenced by this handle. More...
 
const ResourceT * getResource () const
 
DialectT * getDialect () const
 Return the dialect that owns the resource. More...
 
- Public Member Functions inherited from mlir::AsmDialectResourceHandle
 AsmDialectResourceHandle ()=default
 
 AsmDialectResourceHandle (void *resource, TypeID resourceID, Dialect *dialect)
 
bool operator== (const AsmDialectResourceHandle &other) const
 
void * getResource () const
 Return an opaque pointer to the referenced resource. More...
 
TypeID getTypeID () const
 Return the type ID of the resource. More...
 
DialectgetDialect () const
 Return the dialect that owns the resource. More...
 

Static Public Member Functions

static bool classof (const AsmDialectResourceHandle *handle)
 Support llvm style casting. More...
 

Detailed Description

template<typename DerivedT, typename ResourceT, typename DialectT>
class mlir::AsmDialectResourceHandleBase< DerivedT, ResourceT, DialectT >

This class represents a CRTP base class for dialect resource handles.

It abstracts away various utilities necessary for defined derived resource handles.

Definition at line 64 of file OpImplementation.h.

Member Typedef Documentation

◆ Dialect

template<typename DerivedT , typename ResourceT , typename DialectT >
using mlir::AsmDialectResourceHandleBase< DerivedT, ResourceT, DialectT >::Dialect = DialectT

Definition at line 66 of file OpImplementation.h.

Constructor & Destructor Documentation

◆ AsmDialectResourceHandleBase() [1/2]

template<typename DerivedT , typename ResourceT , typename DialectT >
mlir::AsmDialectResourceHandleBase< DerivedT, ResourceT, DialectT >::AsmDialectResourceHandleBase ( ResourceT *  resource,
DialectT *  dialect 
)
inline

Construct a handle from a pointer to the resource.

The given pointer should be guaranteed to live beyond the life of this handle.

Definition at line 70 of file OpImplementation.h.

◆ AsmDialectResourceHandleBase() [2/2]

template<typename DerivedT , typename ResourceT , typename DialectT >
mlir::AsmDialectResourceHandleBase< DerivedT, ResourceT, DialectT >::AsmDialectResourceHandleBase ( AsmDialectResourceHandle  handle)
inline

Definition at line 72 of file OpImplementation.h.

References mlir::AsmDialectResourceHandle::getTypeID().

Member Function Documentation

◆ classof()

template<typename DerivedT , typename ResourceT , typename DialectT >
static bool mlir::AsmDialectResourceHandleBase< DerivedT, ResourceT, DialectT >::classof ( const AsmDialectResourceHandle handle)
inlinestatic

Support llvm style casting.

Definition at line 91 of file OpImplementation.h.

References mlir::AsmDialectResourceHandle::getTypeID().

◆ getDialect()

template<typename DerivedT , typename ResourceT , typename DialectT >
DialectT* mlir::AsmDialectResourceHandleBase< DerivedT, ResourceT, DialectT >::getDialect ( ) const
inline

Return the dialect that owns the resource.

Definition at line 86 of file OpImplementation.h.

References mlir::AsmDialectResourceHandle::getDialect().

◆ getResource() [1/2]

template<typename DerivedT , typename ResourceT , typename DialectT >
ResourceT* mlir::AsmDialectResourceHandleBase< DerivedT, ResourceT, DialectT >::getResource ( )
inline

Return the resource referenced by this handle.

Definition at line 78 of file OpImplementation.h.

References mlir::AsmDialectResourceHandle::getResource().

Referenced by mlir::AsmDialectResourceHandleBase< DerivedT, ResourceT, DialectT >::getResource().

◆ getResource() [2/2]

template<typename DerivedT , typename ResourceT , typename DialectT >
const ResourceT* mlir::AsmDialectResourceHandleBase< DerivedT, ResourceT, DialectT >::getResource ( ) const
inline

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