MLIR  20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
mlir::OpTrait::SingleBlock< ConcreteType > Struct Template Reference

This class provides APIs and verifiers for ops with regions having a single block. More...

#include "mlir/IR/OpDefinition.h"

+ Inheritance diagram for mlir::OpTrait::SingleBlock< ConcreteType >:

Public Types

template<typename OpT , typename T = void>
using enable_if_single_region = std::enable_if_t< OpT::template hasTrait< OneRegion >(), T >
 The following are a set of methods only enabled when the parent operation has a single region. More...
 

Public Member Functions

BlockgetBody (unsigned idx=0)
 
RegiongetBodyRegion (unsigned idx=0)
 
template<typename OpT = ConcreteType>
enable_if_single_region< OpT, Block::iteratorbegin ()
 
template<typename OpT = ConcreteType>
enable_if_single_region< OpT, Block::iteratorend ()
 
template<typename OpT = ConcreteType>
enable_if_single_region< OpT, Operation & > front ()
 
template<typename OpT = ConcreteType>
enable_if_single_region< OpT > push_back (Operation *op)
 Insert the operation into the back of the body. More...
 
template<typename OpT = ConcreteType>
enable_if_single_region< OpT > insert (Operation *insertPt, Operation *op)
 Insert the operation at the given insertion point. More...
 
template<typename OpT = ConcreteType>
enable_if_single_region< OpT > insert (Block::iterator insertPt, Operation *op)
 

Static Public Member Functions

static LogicalResult verifyTrait (Operation *op)
 

Additional Inherited Members

- Protected Member Functions inherited from mlir::OpTrait::TraitBase< ConcreteType, SingleBlock >
OperationgetOperation ()
 Return the ultimate Operation being worked on. More...
 

Detailed Description

template<typename ConcreteType>
struct mlir::OpTrait::SingleBlock< ConcreteType >

This class provides APIs and verifiers for ops with regions having a single block.

Definition at line 871 of file OpDefinition.h.

Member Typedef Documentation

◆ enable_if_single_region

template<typename ConcreteType >
template<typename OpT , typename T = void>
using mlir::OpTrait::SingleBlock< ConcreteType >::enable_if_single_region = std::enable_if_t<OpT::template hasTrait<OneRegion>(), T>

The following are a set of methods only enabled when the parent operation has a single region.

Each of these methods take an additional template parameter that represents the concrete operation so that we can use SFINAE to disable the methods for non-single region operations.

Definition at line 913 of file OpDefinition.h.

Member Function Documentation

◆ begin()

template<typename ConcreteType >
template<typename OpT = ConcreteType>
enable_if_single_region<OpT, Block::iterator> mlir::OpTrait::SingleBlock< ConcreteType >::begin ( )
inline

◆ end()

template<typename ConcreteType >
template<typename OpT = ConcreteType>
enable_if_single_region<OpT, Block::iterator> mlir::OpTrait::SingleBlock< ConcreteType >::end ( )
inline

◆ front()

template<typename ConcreteType >
template<typename OpT = ConcreteType>
enable_if_single_region<OpT, Operation &> mlir::OpTrait::SingleBlock< ConcreteType >::front ( )
inline

◆ getBody()

template<typename ConcreteType >
Block* mlir::OpTrait::SingleBlock< ConcreteType >::getBody ( unsigned  idx = 0)
inline

◆ getBodyRegion()

template<typename ConcreteType >
Region& mlir::OpTrait::SingleBlock< ConcreteType >::getBodyRegion ( unsigned  idx = 0)
inline

◆ insert() [1/2]

template<typename ConcreteType >
template<typename OpT = ConcreteType>
enable_if_single_region<OpT> mlir::OpTrait::SingleBlock< ConcreteType >::insert ( Block::iterator  insertPt,
Operation op 
)
inline

◆ insert() [2/2]

template<typename ConcreteType >
template<typename OpT = ConcreteType>
enable_if_single_region<OpT> mlir::OpTrait::SingleBlock< ConcreteType >::insert ( Operation insertPt,
Operation op 
)
inline

Insert the operation at the given insertion point.

Definition at line 937 of file OpDefinition.h.

Referenced by mlir::OpTrait::SingleBlock< ConcreteType >::push_back().

◆ push_back()

template<typename ConcreteType >
template<typename OpT = ConcreteType>
enable_if_single_region<OpT> mlir::OpTrait::SingleBlock< ConcreteType >::push_back ( Operation op)
inline

◆ verifyTrait()

template<typename ConcreteType >
static LogicalResult mlir::OpTrait::SingleBlock< ConcreteType >::verifyTrait ( Operation op)
inlinestatic

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