MLIR 22.0.0git
mlir::pdll::ast::OperationExpr Class Referencefinal

This expression represents the structural form of an MLIR Operation. More...

#include "mlir/Tools/PDLL/AST/Nodes.h"

Inheritance diagram for mlir::pdll::ast::OperationExpr:

Public Member Functions

std::optional< StringRef > getName () const
 Return the name of the operation, or std::nullopt if there isn't one.
const OpNameDeclgetNameDecl () const
 Return the declaration of the operation name.
SMRange getNameLoc () const
 Return the location of the name of the operation expression, or an invalid location if there isn't a name.
MutableArrayRef< Expr * > getOperands ()
 Return the operands of this operation.
ArrayRef< Expr * > getOperands () const
MutableArrayRef< Expr * > getResultTypes ()
 Return the result types of this operation.
MutableArrayRef< Expr * > getResultTypes () const
MutableArrayRef< NamedAttributeDecl * > getAttributes ()
 Return the attributes of this operation.
ArrayRef< NamedAttributeDecl * > getAttributes () const
Public Member Functions inherited from mlir::pdll::ast::Expr
Type getType () const
 Return the type of this expression.
Public Member Functions inherited from mlir::pdll::ast::Stmt
 Node (TypeID typeID, SMRange loc)
Public Member Functions inherited from mlir::pdll::ast::Node
TypeID getTypeID () const
 Return the type identifier of this node.
SMRange getLoc () const
 Return the location of this node.
void print (raw_ostream &os) const
 Print this node to the given stream.
void walk (function_ref< void(const Node *)> walkFn) const
 Walk all of the nodes including, and nested under, this node in pre-order.
template<typename WalkFnT, typename ArgT = typename llvm::function_traits< WalkFnT>::template arg_t<0>>
std::enable_if_t<!std::is_convertible< const Node *, ArgT >::value > walk (WalkFnT &&walkFn) const

Static Public Member Functions

static OperationExprcreate (Context &ctx, SMRange loc, const ods::Operation *odsOp, const OpNameDecl *nameDecl, ArrayRef< Expr * > operands, ArrayRef< Expr * > resultTypes, ArrayRef< NamedAttributeDecl * > attributes)
Static Public Member Functions inherited from mlir::pdll::ast::Node::NodeBase< OperationExpr, Expr >
static bool classof (const Node *node)
 Provide type casting support.
Static Public Member Functions inherited from mlir::pdll::ast::Expr
static bool classof (const Node *node)
 Provide type casting support.
Static Public Member Functions inherited from mlir::pdll::ast::Stmt
static bool classof (const Node *node)
 Provide type casting support.

Additional Inherited Members

Public Types inherited from mlir::pdll::ast::Node::NodeBase< OperationExpr, Expr >
using Base
Protected Member Functions inherited from mlir::pdll::ast::Node::NodeBase< OperationExpr, Expr >
 NodeBase (SMRange loc, Args &&...args)
Protected Member Functions inherited from mlir::pdll::ast::Expr
 Expr (TypeID typeID, SMRange loc, Type type)
Protected Member Functions inherited from mlir::pdll::ast::Node
 Node (TypeID typeID, SMRange loc)

Detailed Description

This expression represents the structural form of an MLIR Operation.

It represents either an input operation to match, or an operation to create within a rewrite.

Definition at line 509 of file Nodes.h.

Member Function Documentation

◆ create()

OperationExpr * OperationExpr::create ( Context & ctx,
SMRange loc,
const ods::Operation * odsOp,
const OpNameDecl * nameDecl,
ArrayRef< Expr * > operands,
ArrayRef< Expr * > resultTypes,
ArrayRef< NamedAttributeDecl * > attributes )
static

◆ getAttributes() [1/2]

MutableArrayRef< NamedAttributeDecl * > mlir::pdll::ast::OperationExpr::getAttributes ( )
inline

Return the attributes of this operation.

Definition at line 548 of file Nodes.h.

Referenced by create().

◆ getAttributes() [2/2]

ArrayRef< NamedAttributeDecl * > mlir::pdll::ast::OperationExpr::getAttributes ( ) const
inline

Definition at line 551 of file Nodes.h.

◆ getName()

std::optional< StringRef > OperationExpr::getName ( ) const

Return the name of the operation, or std::nullopt if there isn't one.

Definition at line 327 of file Nodes.cpp.

References mlir::pdll::ast::OpNameDecl::getName(), and getNameDecl().

◆ getNameDecl()

const OpNameDecl * mlir::pdll::ast::OperationExpr::getNameDecl ( ) const
inline

Return the declaration of the operation name.

Definition at line 525 of file Nodes.h.

Referenced by getName().

◆ getNameLoc()

SMRange mlir::pdll::ast::OperationExpr::getNameLoc ( ) const
inline

Return the location of the name of the operation expression, or an invalid location if there isn't a name.

Definition at line 529 of file Nodes.h.

◆ getOperands() [1/2]

MutableArrayRef< Expr * > mlir::pdll::ast::OperationExpr::getOperands ( )
inline

Return the operands of this operation.

Definition at line 532 of file Nodes.h.

Referenced by create().

◆ getOperands() [2/2]

ArrayRef< Expr * > mlir::pdll::ast::OperationExpr::getOperands ( ) const
inline

Definition at line 535 of file Nodes.h.

◆ getResultTypes() [1/2]

MutableArrayRef< Expr * > mlir::pdll::ast::OperationExpr::getResultTypes ( )
inline

Return the result types of this operation.

Definition at line 540 of file Nodes.h.

Referenced by create(), and getResultTypes().

◆ getResultTypes() [2/2]

MutableArrayRef< Expr * > mlir::pdll::ast::OperationExpr::getResultTypes ( ) const
inline

Definition at line 543 of file Nodes.h.

References getResultTypes().


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