MLIR  16.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 >:
+ Collaboration diagram for mlir::OpTrait::SingleBlock< ConcreteType >:

Public Types

template<typename OpT , typename T = void>
using enable_if_single_region = typename 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 814 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 = typename 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 857 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

Definition at line 860 of file OpDefinition.h.

◆ end()

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

Definition at line 864 of file OpDefinition.h.

◆ front()

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

Definition at line 868 of file OpDefinition.h.

◆ getBody()

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

Definition at line 838 of file OpDefinition.h.

References mlir::Region::empty(), and mlir::Region::front().

◆ getBodyRegion()

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

Definition at line 843 of file OpDefinition.h.

◆ insert() [1/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 880 of file OpDefinition.h.

◆ insert() [2/2]

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

Definition at line 884 of file OpDefinition.h.

◆ push_back()

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

Insert the operation into the back of the body.

Definition at line 874 of file OpDefinition.h.

◆ 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: