MLIR  20.0.0git
Public Member Functions | Protected Attributes | List of all members
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:

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...
 

Additional Inherited Members

- 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 144 of file Predicate.h.

Constructor & Destructor Documentation

◆ Position()

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

Definition at line 146 of file Predicate.h.

◆ ~Position()

Position::~Position ( )
virtualdefault

Member Function Documentation

◆ getKind()

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

Returns the kind of this position.

Definition at line 156 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 comparePosDepth(), mlir::pdl_to_pdl_interp::OperationPosition::get(), and 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 153 of file Predicate.h.

References parent.

Member Data Documentation

◆ parent

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

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