MLIR  16.0.0git
Public Types | Public Member Functions | List of all members
mlir::OwningOpRef< OpTy > Class Template Reference

This class acts as an owning reference to an op, and will automatically destroy the held op on destruction if the held op is valid. More...

#include "mlir/IR/OwningOpRef.h"

+ Inheritance diagram for mlir::OwningOpRef< OpTy >:

Public Types

using OperationT = OpTy
 The underlying operation type stored in this reference. More...
 

Public Member Functions

 OwningOpRef (std::nullptr_t=nullptr)
 
 OwningOpRef (OpTy op)
 
 OwningOpRef (OwningOpRef &&other)
 
 ~OwningOpRef ()
 
OwningOpRefoperator= (OwningOpRef &&other)
 Assign from another op reference. More...
 
OpTy get () const
 Allow accessing the internal op. More...
 
OpTy operator* () const
 
OpTy * operator-> ()
 
 operator bool () const
 
OpTy release ()
 Release the referenced op. More...
 

Detailed Description

template<typename OpTy>
class mlir::OwningOpRef< OpTy >

This class acts as an owning reference to an op, and will automatically destroy the held op on destruction if the held op is valid.

Note that OpBuilder and related functionality should be highly preferred instead, and this should only be used in situations where existing solutions are not viable.

Definition at line 27 of file OwningOpRef.h.

Member Typedef Documentation

◆ OperationT

template<typename OpTy>
using mlir::OwningOpRef< OpTy >::OperationT = OpTy

The underlying operation type stored in this reference.

Definition at line 30 of file OwningOpRef.h.

Constructor & Destructor Documentation

◆ OwningOpRef() [1/3]

template<typename OpTy>
mlir::OwningOpRef< OpTy >::OwningOpRef ( std::nullptr_t  = nullptr)
inline

Definition at line 32 of file OwningOpRef.h.

◆ OwningOpRef() [2/3]

template<typename OpTy>
mlir::OwningOpRef< OpTy >::OwningOpRef ( OpTy  op)
inline

Definition at line 33 of file OwningOpRef.h.

◆ OwningOpRef() [3/3]

template<typename OpTy>
mlir::OwningOpRef< OpTy >::OwningOpRef ( OwningOpRef< OpTy > &&  other)
inline

Definition at line 34 of file OwningOpRef.h.

◆ ~OwningOpRef()

template<typename OpTy>
mlir::OwningOpRef< OpTy >::~OwningOpRef ( )
inline

Definition at line 35 of file OwningOpRef.h.

Member Function Documentation

◆ get()

template<typename OpTy>
OpTy mlir::OwningOpRef< OpTy >::get ( ) const
inline

Allow accessing the internal op.

Definition at line 49 of file OwningOpRef.h.

Referenced by mlir::ReductionNode::getModule(), and mlir::mlirReduceMain().

◆ operator bool()

template<typename OpTy>
mlir::OwningOpRef< OpTy >::operator bool ( ) const
inlineexplicit

Definition at line 52 of file OwningOpRef.h.

◆ operator*()

template<typename OpTy>
OpTy mlir::OwningOpRef< OpTy >::operator* ( ) const
inline

Definition at line 50 of file OwningOpRef.h.

◆ operator->()

template<typename OpTy>
OpTy* mlir::OwningOpRef< OpTy >::operator-> ( )
inline

Definition at line 51 of file OwningOpRef.h.

◆ operator=()

template<typename OpTy>
OwningOpRef& mlir::OwningOpRef< OpTy >::operator= ( OwningOpRef< OpTy > &&  other)
inline

Assign from another op reference.

Definition at line 41 of file OwningOpRef.h.

◆ release()

template<typename OpTy>
OpTy mlir::OwningOpRef< OpTy >::release ( )
inline

Release the referenced op.

Definition at line 55 of file OwningOpRef.h.

Referenced by deserializeModule(), mlirModuleCreateParse(), roundTripModule(), and mlir::ReductionNode::update().


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