MLIR  20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::pdll::ast::UserRewriteDecl Class Referencefinal

This decl represents a user defined rewrite. More...

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

+ Inheritance diagram for mlir::pdll::ast::UserRewriteDecl:

Public Member Functions

const NamegetName () const
 Return the name of the rewrite. More...
 
MutableArrayRef< VariableDecl * > getInputs ()
 Return the input arguments of this rewrite. More...
 
ArrayRef< VariableDecl * > getInputs () const
 
MutableArrayRef< VariableDecl * > getResults ()
 Return the explicit results of the rewrite declaration. More...
 
ArrayRef< VariableDecl * > getResults () const
 
std::optional< StringRef > getCodeBlock () const
 Return the optional code block of this rewrite, if this is a native rewrite with a provided implementation. More...
 
const CompoundStmtgetBody () const
 Return the body of this rewrite if this rewrite is a PDLL rewrite, otherwise returns nullptr. More...
 
Type getResultType () const
 Return the result type of this rewrite. More...
 
bool isExternal () const
 Returns true if this rewrite is external. More...
 

Static Public Member Functions

static UserRewriteDeclcreateNative (Context &ctx, const Name &name, ArrayRef< VariableDecl * > inputs, ArrayRef< VariableDecl * > results, std::optional< StringRef > codeBlock, Type resultType)
 Create a native rewrite with the given optional code block. More...
 
static UserRewriteDeclcreatePDLL (Context &ctx, const Name &name, ArrayRef< VariableDecl * > inputs, ArrayRef< VariableDecl * > results, const CompoundStmt *body, Type resultType)
 Create a PDLL rewrite with the given body. More...
 
- Static Public Member Functions inherited from mlir::pdll::ast::Node::NodeBase< T, BaseT >
static bool classof (const Node *node)
 Provide type casting support. More...
 

Additional Inherited Members

- Public Types inherited from mlir::pdll::ast::Node::NodeBase< T, BaseT >
using Base = NodeBase< T, BaseT >
 
- Protected Member Functions inherited from mlir::pdll::ast::Node::NodeBase< T, BaseT >
template<typename... Args>
 NodeBase (SMRange loc, Args &&...args)
 

Detailed Description

This decl represents a user defined rewrite.

This is either:

Definition at line 1090 of file Nodes.h.

Member Function Documentation

◆ createNative()

static UserRewriteDecl* mlir::pdll::ast::UserRewriteDecl::createNative ( Context ctx,
const Name name,
ArrayRef< VariableDecl * >  inputs,
ArrayRef< VariableDecl * >  results,
std::optional< StringRef >  codeBlock,
Type  resultType 
)
inlinestatic

Create a native rewrite with the given optional code block.

Definition at line 1095 of file Nodes.h.

◆ createPDLL()

static UserRewriteDecl* mlir::pdll::ast::UserRewriteDecl::createPDLL ( Context ctx,
const Name name,
ArrayRef< VariableDecl * >  inputs,
ArrayRef< VariableDecl * >  results,
const CompoundStmt body,
Type  resultType 
)
inlinestatic

Create a PDLL rewrite with the given body.

Definition at line 1105 of file Nodes.h.

◆ getBody()

const CompoundStmt* mlir::pdll::ast::UserRewriteDecl::getBody ( ) const
inline

Return the body of this rewrite if this rewrite is a PDLL rewrite, otherwise returns nullptr.

Definition at line 1140 of file Nodes.h.

◆ getCodeBlock()

std::optional<StringRef> mlir::pdll::ast::UserRewriteDecl::getCodeBlock ( ) const
inline

Return the optional code block of this rewrite, if this is a native rewrite with a provided implementation.

Definition at line 1136 of file Nodes.h.

◆ getInputs() [1/2]

MutableArrayRef<VariableDecl *> mlir::pdll::ast::UserRewriteDecl::getInputs ( )
inline

Return the input arguments of this rewrite.

Definition at line 1118 of file Nodes.h.

Referenced by getInputs().

◆ getInputs() [2/2]

ArrayRef<VariableDecl *> mlir::pdll::ast::UserRewriteDecl::getInputs ( ) const
inline

Definition at line 1121 of file Nodes.h.

References getInputs().

◆ getName()

const Name& mlir::pdll::ast::UserRewriteDecl::getName ( ) const
inline

Return the name of the rewrite.

Definition at line 1115 of file Nodes.h.

References mlir::pdll::ast::Decl::getName().

◆ getResults() [1/2]

MutableArrayRef<VariableDecl *> mlir::pdll::ast::UserRewriteDecl::getResults ( )
inline

Return the explicit results of the rewrite declaration.

May be empty, even if the rewrite has results (e.g. in the case of inferred results).

Definition at line 1127 of file Nodes.h.

Referenced by getResults().

◆ getResults() [2/2]

ArrayRef<VariableDecl *> mlir::pdll::ast::UserRewriteDecl::getResults ( ) const
inline

Definition at line 1130 of file Nodes.h.

References getResults().

◆ getResultType()

Type mlir::pdll::ast::UserRewriteDecl::getResultType ( ) const
inline

Return the result type of this rewrite.

Definition at line 1143 of file Nodes.h.

◆ isExternal()

bool mlir::pdll::ast::UserRewriteDecl::isExternal ( ) const
inline

Returns true if this rewrite is external.

Definition at line 1146 of file Nodes.h.


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