MLIR  15.0.0git
mlir::pdl_to_pdl_interp::Position Class Reference

A position describes a value on the input IR on which a predicate may be applied, such as an operation or attribute. More...

#include "Conversion/PDLToPDLInterp/Predicate.h"

Inheritance diagram for mlir::pdl_to_pdl_interp::Position:
Collaboration diagram for mlir::pdl_to_pdl_interp::Position:

## Public Member Functions

Position (Predicates::Kind kind)

virtual ~Position ()

unsigned getOperationDepth () const
Returns the depth of the first ancestor operation position. More...

PositiongetParent () const
Returns the parent position. The root operation position has no parent. More...

Predicates::Kind getKind () const
Returns the kind of this position. More...

## Protected Attributes

Positionparent = nullptr
Link to the parent position. More...

Protected Member Functions inherited from mlir::StorageUniquer::BaseStorage
BaseStorage ()=default

## Detailed Description

A position describes a value on the input IR on which a predicate may be applied, such as an operation or attribute.

This enables re-use between predicates, and assists generating bytecode and memory management.

Operation positions form the base of other positions, which are formed relative to a parent operation. Operations are anchored at Operand nodes, except for the root operation which is parentless.

Definition at line 143 of file Predicate.h.

## ◆ Position()

 mlir::pdl_to_pdl_interp::Position::Position ( Predicates::Kind kind )
inlineexplicit

Definition at line 145 of file Predicate.h.

## ◆ ~Position()

 Position::~Position ( )
virtualdefault

## ◆ getKind()

 Predicates::Kind mlir::pdl_to_pdl_interp::Position::getKind ( ) const
inline

Returns the kind of this position.

Definition at line 155 of file Predicate.h.

## ◆ getOperationDepth()

 unsigned Position::getOperationDepth ( ) const

Returns the depth of the first ancestor operation position.

Definition at line 21 of file Predicate.cpp.

References getOperationDepth(), and parent.

Referenced by getOperationDepth().

## ◆ getParent()

 Position* mlir::pdl_to_pdl_interp::Position::getParent ( ) const
inline

Returns the parent position. The root operation position has no parent.

Definition at line 152 of file Predicate.h.

## ◆ parent

 Position* mlir::pdl_to_pdl_interp::Position::parent = nullptr
protected