MLIR  15.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
mlir::pdl_to_pdl_interp::SwitchNode Struct Reference

A SwitchNode denotes a question with multiple potential results. More...

#include "Conversion/PDLToPDLInterp/PredicateTree.h"

+ Inheritance diagram for mlir::pdl_to_pdl_interp::SwitchNode:
+ Collaboration diagram for mlir::pdl_to_pdl_interp::SwitchNode:

Public Types

using ChildMapT = llvm::MapVector< Qualifier *, std::unique_ptr< MatcherNode > >
 Returns the children of this switch node. More...
 

Public Member Functions

 SwitchNode (Position *position, Qualifier *question)
 
ChildMapTgetChildren ()
 
std::pair< Qualifier *, std::unique_ptr< MatcherNode > > & getChild (unsigned i)
 Returns the child at the given index. More...
 
- Public Member Functions inherited from mlir::pdl_to_pdl_interp::MatcherNode
virtual ~MatcherNode ()=default
 
PositiongetPosition () const
 Returns the position on which the question predicate should be checked. More...
 
QualifiergetQuestion () const
 Returns the predicate checked on this node. More...
 
std::unique_ptr< MatcherNode > & getFailureNode ()
 Returns the node that should be visited if this, or a subsequent node fails. More...
 
void setFailureNode (std::unique_ptr< MatcherNode > node)
 Sets the node that should be visited if this, or a subsequent node fails. More...
 
TypeID getMatcherTypeID () const
 Returns the unique type ID of this matcher instance. More...
 

Static Public Member Functions

static bool classof (const MatcherNode *node)
 Returns if the given matcher node is an instance of this class, used to support type casting. More...
 
- Static Public Member Functions inherited from mlir::pdl_to_pdl_interp::MatcherNode
static std::unique_ptr< MatcherNodegenerateMatcherTree (ModuleOp module, PredicateBuilder &builder, DenseMap< Value, Position *> &valueToPosition)
 Given a module containing PDL pattern operations, generate a matcher tree using the patterns within the given module and return the root matcher node. More...
 

Additional Inherited Members

- Protected Member Functions inherited from mlir::pdl_to_pdl_interp::MatcherNode
 MatcherNode (TypeID matcherTypeID, Position *position=nullptr, Qualifier *question=nullptr, std::unique_ptr< MatcherNode > failureNode=nullptr)
 

Detailed Description

A SwitchNode denotes a question with multiple potential results.

These nodes branch to a specific node based on the result of the question.

Definition at line 184 of file PredicateTree.h.

Member Typedef Documentation

◆ ChildMapT

using mlir::pdl_to_pdl_interp::SwitchNode::ChildMapT = llvm::MapVector<Qualifier *, std::unique_ptr<MatcherNode> >

Returns the children of this switch node.

The children are contained within a mapping between the various case answers to destination matcher nodes.

Definition at line 196 of file PredicateTree.h.

Constructor & Destructor Documentation

◆ SwitchNode()

SwitchNode::SwitchNode ( Position position,
Qualifier question 
)

Definition at line 999 of file PredicateTree.cpp.

Member Function Documentation

◆ classof()

static bool mlir::pdl_to_pdl_interp::SwitchNode::classof ( const MatcherNode node)
inlinestatic

Returns if the given matcher node is an instance of this class, used to support type casting.

Definition at line 189 of file PredicateTree.h.

References mlir::pdl_to_pdl_interp::MatcherNode::getMatcherTypeID().

◆ getChild()

std::pair<Qualifier *, std::unique_ptr<MatcherNode> >& mlir::pdl_to_pdl_interp::SwitchNode::getChild ( unsigned  i)
inline

Returns the child at the given index.

Definition at line 200 of file PredicateTree.h.

◆ getChildren()

ChildMapT& mlir::pdl_to_pdl_interp::SwitchNode::getChildren ( )
inline

Definition at line 197 of file PredicateTree.h.

Referenced by createSwitchOp(), and getOrCreateChild().


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