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

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

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

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

Public Member Functions

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

Static Public Member Functions

static UserConstraintDeclcreateNative (Context &ctx, const Name &name, ArrayRef< VariableDecl * > inputs, ArrayRef< VariableDecl * > results, std::optional< StringRef > codeBlock, Type resultType, ArrayRef< StringRef > nativeInputTypes={})
 Create a native constraint with the given optional code block. More...
 
static UserConstraintDeclcreatePDLL (Context &ctx, const Name &name, ArrayRef< VariableDecl * > inputs, ArrayRef< VariableDecl * > results, const CompoundStmt *body, Type resultType)
 Create a PDLL constraint 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 constraint.

This is either:

Definition at line 880 of file Nodes.h.

Member Function Documentation

◆ createNative()

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

Create a native constraint with the given optional code block.

Definition at line 886 of file Nodes.h.

◆ createPDLL()

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

Create a PDLL constraint with the given body.

Definition at line 895 of file Nodes.h.

◆ getBody()

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

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

Definition at line 934 of file Nodes.h.

◆ getCodeBlock()

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

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

Definition at line 930 of file Nodes.h.

◆ getInputs() [1/2]

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

Return the input arguments of this constraint.

Definition at line 908 of file Nodes.h.

Referenced by getInputs().

◆ getInputs() [2/2]

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

Definition at line 911 of file Nodes.h.

References getInputs().

◆ getName()

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

Return the name of the constraint.

Definition at line 905 of file Nodes.h.

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

◆ getNativeInputType()

std::optional< StringRef > UserConstraintDecl::getNativeInputType ( unsigned  index) const

Return the explicit native type to use for the given input.

Returns std::nullopt if no explicit type was set.

Definition at line 457 of file Nodes.cpp.

◆ getResults() [1/2]

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

Return the explicit results of the constraint declaration.

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

Definition at line 921 of file Nodes.h.

Referenced by getResults().

◆ getResults() [2/2]

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

Definition at line 924 of file Nodes.h.

References getResults().

◆ getResultType()

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

Return the result type of this constraint.

Definition at line 937 of file Nodes.h.

◆ isExternal()

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

Returns true if this constraint is external.

Definition at line 940 of file Nodes.h.


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