MLIR  17.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
mlir::BoolAttr Class Reference

Special case of IntegerAttr to represent boolean integers, i.e., signless i1 integers. More...

#include "mlir/IR/BuiltinAttributes.h"

+ Inheritance diagram for mlir::BoolAttr:
+ Collaboration diagram for mlir::BoolAttr:

Public Types

using ValueType = bool
 
- Public Types inherited from mlir::Attribute
template<typename ConcreteType , typename BaseType , typename StorageType , template< typename T > class... Traits>
using AttrBase = detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::AttributeUniquer, Traits... >
 Utility class for implementing attributes. More...
 
using ImplType = AttributeStorage
 
using ValueType = void
 
using AbstractTy = AbstractAttribute
 

Public Member Functions

 operator IntegerAttr () const
 Enable conversion to IntegerAttr. More...
 
bool getValue () const
 Return the boolean value of this attribute. More...
 
constexpr Attribute ()=default
 
 Attribute (const ImplType *impl)
 
 Attribute (const Attribute &other)=default
 
- Public Member Functions inherited from mlir::Attribute
constexpr Attribute ()=default
 
 Attribute (const ImplType *impl)
 
 Attribute (const Attribute &other)=default
 
Attributeoperator= (const Attribute &other)=default
 
bool operator== (Attribute other) const
 
bool operator!= (Attribute other) const
 
 operator bool () const
 
bool operator! () const
 
template<typename... Tys>
bool isa () const
 Casting utility functions. More...
 
template<typename... Tys>
bool isa_and_nonnull () const
 
template<typename U >
dyn_cast () const
 
template<typename U >
dyn_cast_or_null () const
 
template<typename U >
cast () const
 
TypeID getTypeID ()
 Return a unique identifier for the concrete attribute type. More...
 
MLIRContextgetContext () const
 Return the context this attribute belongs to. More...
 
DialectgetDialect () const
 Get the dialect this attribute is registered to. More...
 
void print (raw_ostream &os, bool elideType=false) const
 Print the attribute. More...
 
void print (raw_ostream &os, AsmState &state, bool elideType=false) const
 
void dump () const
 
const void * getAsOpaquePointer () const
 Get an opaque pointer to the attribute. More...
 
template<template< typename T > class Trait>
bool hasTrait ()
 Returns true if the type was registered with a particular trait. More...
 
const AbstractTygetAbstractAttribute () const
 Return the abstract descriptor for this attribute. More...
 
void walkImmediateSubElements (function_ref< void(Attribute)> walkAttrsFn, function_ref< void(Type)> walkTypesFn) const
 Walk all of the immediately nested sub-attributes and sub-types. More...
 
auto replaceImmediateSubElements (ArrayRef< Attribute > replAttrs, ArrayRef< Type > replTypes) const
 Replace the immediately nested sub-attributes and sub-types with those provided. More...
 
template<WalkOrder Order = WalkOrder::PostOrder, typename... WalkFns>
auto walk (WalkFns &&...walkFns)
 Walk this attribute and all attibutes/types nested within using the provided walk functions. More...
 
template<typename... ReplacementFns>
auto replace (ReplacementFns &&...replacementFns)
 Recursively replace all of the nested sub-attributes and sub-types using the provided map functions. More...
 
ImplTypegetImpl () const
 Return the internal Attribute implementation. More...
 

Static Public Member Functions

static BoolAttr get (MLIRContext *context, bool value)
 
static bool classof (Attribute attr)
 Methods for support type inquiry through isa, cast, and dyn_cast. More...
 
- Static Public Member Functions inherited from mlir::Attribute
static bool classof (Attribute)
 
static Attribute getFromOpaquePointer (const void *ptr)
 Construct an attribute from the opaque pointer representation. More...
 

Additional Inherited Members

- Protected Attributes inherited from mlir::Attribute
ImplTypeimpl {nullptr}
 

Detailed Description

Special case of IntegerAttr to represent boolean integers, i.e., signless i1 integers.

Definition at line 838 of file BuiltinAttributes.h.

Member Typedef Documentation

◆ ValueType

Definition at line 841 of file BuiltinAttributes.h.

Member Function Documentation

◆ Attribute() [1/3]

constexpr mlir::Attribute::Attribute
constexprdefault

◆ Attribute() [2/3]

mlir::Attribute::Attribute
default

◆ Attribute() [3/3]

mlir::Attribute::Attribute
inline

Definition at line 38 of file Attributes.h.

◆ classof()

bool BoolAttr::classof ( Attribute  attr)
static

Methods for support type inquiry through isa, cast, and dyn_cast.

Definition at line 405 of file BuiltinAttributes.cpp.

References mlir::Attribute::dyn_cast().

◆ get()

BoolAttr BoolAttr::get ( MLIRContext context,
bool  value 
)
static

◆ getValue()

bool BoolAttr::getValue ( ) const

Return the boolean value of this attribute.

Definition at line 400 of file BuiltinAttributes.cpp.

Referenced by mlir::tosa::buildQTypeFromMinMax(), TransferWriteNonPermutationLowering::matchAndRewrite(), and verifyTransferOp().

◆ operator IntegerAttr()

mlir::BoolAttr::operator IntegerAttr ( ) const
inline

Enable conversion to IntegerAttr.

This uses conversion vs. inheritance to avoid bringing in all of IntegerAttrs methods.

Definition at line 847 of file BuiltinAttributes.h.


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