MLIR 22.0.0git
mlir::detail::DenseArrayAttrImpl< T > Class Template Reference

Base class for DenseArrayAttr that is instantiated and specialized for each supported element type below. More...

#include "mlir/IR/BuiltinAttributes.h"

Inheritance diagram for mlir::detail::DenseArrayAttrImpl< T >:

Public Member Functions

 operator ArrayRef< T > () const
 Implicit conversion to ArrayRef<T>.
ArrayRef< T > asArrayRef () const
operator[] (std::size_t index) const
 Random access to elements.
void print (AsmPrinter &printer) const
 Print the short form [42, 100, -1] without any type prefix.
void print (raw_ostream &os) const
void printWithoutBraces (raw_ostream &os) const
 Print the short form 42, 100, -1 without any braces or type prefix.

Static Public Member Functions

static DenseArrayAttrImpl get (MLIRContext *context, ArrayRef< T > content)
 Builder from ArrayRef<T>.
static Attribute parse (AsmParser &parser, Type type)
 Parse the short form [42, 100, -1] without any type prefix.
static Attribute parseWithoutBraces (AsmParser &parser, Type type)
 Parse the short form 42, 100, -1 without any type prefix or braces.
static bool classof (Attribute attr)
 Support for isa<>/cast<>.

Detailed Description

template<typename T>
class mlir::detail::DenseArrayAttrImpl< T >

Base class for DenseArrayAttr that is instantiated and specialized for each supported element type below.

Definition at line 726 of file BuiltinAttributes.h.

Member Function Documentation

◆ asArrayRef()

◆ classof()

template<typename T>
bool DenseArrayAttrImpl::classof ( Attribute attr)
static

Support for isa<>/cast<>.

Definition at line 882 of file BuiltinAttributes.cpp.

◆ get()

template<typename T>
DenseArrayAttrImpl< T > DenseArrayAttrImpl::get ( MLIRContext * context,
ArrayRef< T > content )
static

Builder from ArrayRef<T>.

Builds a DenseArrayAttr<T> from an ArrayRef<T>.

Definition at line 872 of file BuiltinAttributes.cpp.

◆ operator ArrayRef< T >()

template<typename T>
DenseArrayAttrImpl::operator ArrayRef< T > ( ) const

Implicit conversion to ArrayRef<T>.

Conversion from DenseArrayAttr<T> to ArrayRef<T>.

Definition at line 863 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::getRawData().

◆ operator[]()

template<typename T>
T mlir::detail::DenseArrayAttrImpl< T >::operator[] ( std::size_t index) const
inline

Random access to elements.

Definition at line 735 of file BuiltinAttributes.h.

◆ parse()

template<typename T>
Attribute DenseArrayAttrImpl::parse ( AsmParser & parser,
Type type )
static

Parse the short form [42, 100, -1] without any type prefix.

Parse a DenseArrayAttr: [ 1, 2, 3 ]

Definition at line 849 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), mlir::AsmParser::getContext(), mlir::AsmParser::parseLSquare(), mlir::AsmParser::parseOptionalRSquare(), mlir::AsmParser::parseRSquare(), parseWithoutBraces(), and result.

◆ parseWithoutBraces()

template<typename T>
Attribute DenseArrayAttrImpl::parseWithoutBraces ( AsmParser & parser,
Type type )
static

Parse the short form 42, 100, -1 without any type prefix or braces.

Parse a DenseArrayAttr without the braces: 1, 2, 3

Definition at line 833 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), mlir::AsmParser::getContext(), and mlir::AsmParser::parseCommaSeparatedList().

Referenced by parse().

◆ print() [1/2]

template<typename T>
void DenseArrayAttrImpl::print ( AsmPrinter & printer) const

Print the short form [42, 100, -1] without any type prefix.

Definition at line 813 of file BuiltinAttributes.cpp.

References mlir::AsmPrinter::getStream(), and mlir::Attribute::print().

◆ print() [2/2]

template<typename T>
void DenseArrayAttrImpl::print ( raw_ostream & os) const

Definition at line 825 of file BuiltinAttributes.cpp.

References printWithoutBraces().

◆ printWithoutBraces()

template<typename T>
void DenseArrayAttrImpl::printWithoutBraces ( raw_ostream & os) const

Print the short form 42, 100, -1 without any braces or type prefix.

Definition at line 818 of file BuiltinAttributes.cpp.

References asArrayRef().

Referenced by print().


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