MLIR 22.0.0git
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
 The following are a set of methods only enabled when the parent operation has a single region.

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.
template<typename OpT = ConcreteType>
enable_if_single_region< OpT > insert (Operation *insertPt, Operation *op)
 Insert the operation at the given insertion point.
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.

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 881 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
Initial value:
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 923 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 927 of file OpDefinition.h.

References mlir::Block::begin(), and getBody().

Referenced by front().

◆ end()

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

Definition at line 931 of file OpDefinition.h.

References mlir::Block::end(), and getBody().

Referenced by push_back().

◆ front()

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

Definition at line 935 of file OpDefinition.h.

References begin().

◆ 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

Definition at line 951 of file OpDefinition.h.

References getBody(), and mlir::Block::getOperations().

◆ 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 947 of file OpDefinition.h.

References insert().

Referenced by insert(), and 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

Insert the operation into the back of the body.

Definition at line 941 of file OpDefinition.h.

References end(), getBody(), and insert().

◆ verifyTrait()

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

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