MLIR  16.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
mlir::PDLValue Class Reference

Storage type of byte-code interpreter values. More...

#include "mlir/IR/PatternMatch.h"

Public Types

enum  Kind {
  Kind::Attribute, Kind::Operation, Kind::Type, Kind::TypeRange,
  Kind::Value, Kind::ValueRange
}
 The underlying kind of a PDL value. More...
 

Public Member Functions

 PDLValue (const PDLValue &other)=default
 Construct a new PDL value. More...
 
 PDLValue (std::nullptr_t=nullptr)
 
 PDLValue (Attribute value)
 
 PDLValue (Operation *value)
 
 PDLValue (Type value)
 
 PDLValue (TypeRange *value)
 
 PDLValue (Value value)
 
 PDLValue (ValueRange *value)
 
template<typename T >
bool isa () const
 Returns true if the type of the held value is T. More...
 
template<typename T , typename ResultT = std::conditional_t< std::is_convertible<T, bool>::value, T, Optional<T>>>
ResultT dyn_cast () const
 Attempt to dynamically cast this value to type T, returns null if this value is not an instance of T. More...
 
template<typename T >
cast () const
 Cast this value to type T, asserts if this value is not an instance of T. More...
 
const voidgetAsOpaquePointer () const
 Get an opaque pointer to the value. More...
 
 operator bool () const
 Return if this value is null or not. More...
 
Kind getKind () const
 Return the kind of this value. More...
 
void print (raw_ostream &os) const
 Print this value to the provided output stream. More...
 

Static Public Member Functions

static void print (raw_ostream &os, Kind kind)
 Print the specified value kind to an output stream. More...
 

Detailed Description

Storage type of byte-code interpreter values.

These are passed to constraint functions as arguments.

Definition at line 614 of file PatternMatch.h.

Member Enumeration Documentation

◆ Kind

enum mlir::PDLValue::Kind
strong

The underlying kind of a PDL value.

Enumerator
Attribute 
Operation 
Type 
TypeRange 
Value 
ValueRange 

Definition at line 617 of file PatternMatch.h.

Constructor & Destructor Documentation

◆ PDLValue() [1/8]

mlir::PDLValue::PDLValue ( const PDLValue other)
default

Construct a new PDL value.

◆ PDLValue() [2/8]

mlir::PDLValue::PDLValue ( std::nullptr_t  = nullptr)
inline

Definition at line 621 of file PatternMatch.h.

◆ PDLValue() [3/8]

mlir::PDLValue::PDLValue ( Attribute  value)
inline

Definition at line 622 of file PatternMatch.h.

◆ PDLValue() [4/8]

mlir::PDLValue::PDLValue ( Operation value)
inline

Definition at line 624 of file PatternMatch.h.

◆ PDLValue() [5/8]

mlir::PDLValue::PDLValue ( Type  value)
inline

Definition at line 625 of file PatternMatch.h.

◆ PDLValue() [6/8]

mlir::PDLValue::PDLValue ( TypeRange value)
inline

Definition at line 626 of file PatternMatch.h.

◆ PDLValue() [7/8]

mlir::PDLValue::PDLValue ( Value  value)
inline

Definition at line 627 of file PatternMatch.h.

◆ PDLValue() [8/8]

mlir::PDLValue::PDLValue ( ValueRange value)
inline

Definition at line 629 of file PatternMatch.h.

Member Function Documentation

◆ cast()

template<typename T >
T mlir::PDLValue::cast ( ) const
inline

Cast this value to type T, asserts if this value is not an instance of T.

Definition at line 650 of file PatternMatch.h.

Referenced by mlir::detail::pdl_function_builder::ProcessBuiltinPDLValue< Value >::processAsArg().

◆ dyn_cast()

template<typename T , typename ResultT = std::conditional_t< std::is_convertible<T, bool>::value, T, Optional<T>>>
ResultT mlir::PDLValue::dyn_cast ( ) const
inline

Attempt to dynamically cast this value to type T, returns null if this value is not an instance of T.

Definition at line 643 of file PatternMatch.h.

◆ getAsOpaquePointer()

const void* mlir::PDLValue::getAsOpaquePointer ( ) const
inline

Get an opaque pointer to the value.

Definition at line 656 of file PatternMatch.h.

References value.

◆ getKind()

Kind mlir::PDLValue::getKind ( ) const
inline

Return the kind of this value.

Definition at line 662 of file PatternMatch.h.

◆ isa()

template<typename T >
bool mlir::PDLValue::isa ( ) const
inline

Returns true if the type of the held value is T.

Definition at line 633 of file PatternMatch.h.

References value.

◆ operator bool()

mlir::PDLValue::operator bool ( ) const
inlineexplicit

Return if this value is null or not.

Definition at line 659 of file PatternMatch.h.

References value.

◆ print() [1/2]

void PDLValue::print ( raw_ostream &  os) const

Print this value to the provided output stream.

Definition at line 102 of file PatternMatch.cpp.

References value.

Referenced by mlir::operator<<().

◆ print() [2/2]

void PDLValue::print ( raw_ostream &  os,
Kind  kind 
)
static

Print the specified value kind to an output stream.

Definition at line 129 of file PatternMatch.cpp.


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