MLIR  16.0.0git
mlir::detail::pdl_function_builder::ProcessPDLValue< T, Enable > Struct Template Reference

This struct provides a convenient way to determine how to process a given type as either a PDL parameter, or a result value. More...

#include "mlir/IR/PatternMatch.h"

Detailed Description

template<typename T, typename Enable = void>
struct mlir::detail::pdl_function_builder::ProcessPDLValue< T, Enable >

This struct provides a convenient way to determine how to process a given type as either a PDL parameter, or a result value.

This allows for supporting complex types in constraint and rewrite functions, without requiring the user to hand-write the necessary glue code themselves. Specializations of this class should implement the following methods to enable support as a PDL argument or result type:

static LogicalResult verifyAsArg( function_ref<LogicalResult(const Twine &)> errorFn, PDLValue pdlValue, size_t argIdx);

static T processAsArg(PDLValue pdlValue);

static void processAsResult(PatternRewriter &, PDLResultList &results, const T &value);

If the type T is based on a higher order value, consider using ProcessPDLValueBasedOn as a base class of the specialization to simplify the implementation.

Definition at line 863 of file PatternMatch.h.


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