MLIR  20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
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>. More...
 
ArrayRef< T > asArrayRef () const
 
operator[] (std::size_t index) const
 Random access to elements. More...
 
void print (AsmPrinter &printer) const
 Print the short form [42, 100, -1] without any type prefix. More...
 
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. More...
 

Static Public Member Functions

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

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 725 of file BuiltinAttributes.h.

Member Function Documentation

◆ asArrayRef()

template<typename T >
ArrayRef<T> mlir::detail::DenseArrayAttrImpl< T >::asArrayRef ( ) const
inline

◆ classof()

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

Support for isa<>/cast<>.

Definition at line 870 of file BuiltinAttributes.cpp.

◆ get()

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

◆ operator ArrayRef< T >()

template<typename T >
DenseArrayAttrImpl::operator ArrayRef< T >

Implicit conversion to ArrayRef<T>.

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

Definition at line 851 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 734 of file BuiltinAttributes.h.

References mlir::detail::DenseArrayAttrImpl< T >::asArrayRef().

◆ 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 837 of file BuiltinAttributes.cpp.

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

Referenced by parseDenseI64ArrayAttr().

◆ 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 821 of file BuiltinAttributes.cpp.

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

◆ 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 801 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 813 of file BuiltinAttributes.cpp.

◆ 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 806 of file BuiltinAttributes.cpp.


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