MLIR
15.0.0git
|
Special case of IntegerAttr to represent boolean integers, i.e., signless i1 integers. More...
#include "mlir/IR/BuiltinAttributes.h"
Public Types | |
using | ValueType = bool |
![]() | |
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 () |
Attribute (const ImplType *impl) | |
Attribute (const Attribute &other)=default | |
Attribute & | operator= (const Attribute &other)=default |
bool | operator== (Attribute other) const |
bool | operator!= (Attribute other) const |
operator bool () const | |
bool | operator! () const |
template<typename U > | |
bool | isa () const |
template<typename First , typename Second , typename... Rest> | |
bool | isa () const |
template<typename First , typename... Rest> | |
bool | isa_and_nonnull () const |
template<typename U > | |
U | dyn_cast () const |
template<typename U > | |
U | dyn_cast_or_null () const |
template<typename U > | |
U | cast () const |
TypeID | getTypeID () |
Return a unique identifier for the concrete attribute type. More... | |
Type | getType () const |
Return the type of this attribute. More... | |
MLIRContext * | getContext () const |
Return the context this attribute belongs to. More... | |
Dialect & | getDialect () const |
Get the dialect this attribute is registered to. More... | |
void | print (raw_ostream &os) const |
Print the attribute. More... | |
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 AbstractTy & | getAbstractAttribute () const |
Return the abstract descriptor for this attribute. 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 bool | classof (Attribute) |
static Attribute | getFromOpaquePointer (const void *ptr) |
Construct an attribute from the opaque pointer representation. More... | |
Additional Inherited Members | |
![]() | |
ImplType * | impl {nullptr} |
Special case of IntegerAttr to represent boolean integers, i.e., signless i1 integers.
Definition at line 752 of file BuiltinAttributes.h.
using mlir::BoolAttr::ValueType = bool |
Definition at line 755 of file BuiltinAttributes.h.
|
static |
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition at line 384 of file BuiltinAttributes.cpp.
References mlir::MLIRContext::allowsUnregisteredDialects(), mlir::Attribute::dyn_cast(), mlir::emitError(), mlir::MLIRContext::getLoadedDialect(), mlir::Dialect::isValidNamespace(), mlir::success(), and mlir::verify().
|
static |
Definition at line 899 of file MLIRContext.cpp.
References mlir::MLIRContextImpl::emptyDictionaryAttr, mlir::MLIRContextImpl::falseAttr, mlir::MLIRContext::getImpl(), mlir::MLIRContextImpl::trueAttr, mlir::MLIRContextImpl::unitAttr, and mlir::MLIRContextImpl::unknownLocAttr.
Referenced by eachHasOnlyOneOfTypes(), mlir::Builder::getBoolAttr(), getBoolAttribute(), hasAtMostSingleNonScalar(), mlirBoolAttrGet(), and setInPlaceFuncArgument().
bool BoolAttr::getValue | ( | ) | const |
Return the boolean value of this attribute.
Definition at line 379 of file BuiltinAttributes.cpp.
Referenced by mlir::tosa::buildQTypeFromMinMax(), eachHasOnlyOneOfTypes(), and getScalarOrSplatBoolAttr().
|
inline |
Enable conversion to IntegerAttr.
This uses conversion vs. inheritance to avoid bringing in all of IntegerAttrs methods.
Definition at line 761 of file BuiltinAttributes.h.