My Project
|
#include <Types.h>
Public Types | |
enum | Kind { Function, Opaque, LAST_BUILTIN_TYPE = Opaque, DEFINE_SYM_KIND_RANGE, DEFINE_SYM_KIND_RANGE } |
template<typename ConcreteType , typename BaseType , typename StorageType = DefaultTypeStorage> | |
using | TypeBase = detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::TypeUniquer > |
Utility class for implementing types. More... | |
using | ImplType = TypeStorage |
Public Member Functions | |
Type () | |
Type (const ImplType *impl) | |
Type (const Type &other)=default | |
Type & | operator= (const Type &other)=default |
bool | operator== (Type other) const |
bool | operator!= (Type other) const |
operator bool () const | |
bool | operator! () const |
template<typename U > | |
bool | isa () const |
template<typename U > | |
U | dyn_cast () const |
template<typename U > | |
U | dyn_cast_or_null () const |
template<typename U > | |
U | cast () const |
unsigned | getKind () const |
Return the classification for this type. More... | |
MLIRContext * | getContext () const |
Return the LLVMContext in which this type was uniqued. More... | |
Dialect & | getDialect () const |
Get the dialect this type is registered to. More... | |
bool | isIndex () |
bool | isBF16 () |
bool | isF16 () |
bool | isF32 () |
bool | isF64 () |
bool | isInteger (unsigned width) |
Return true if this is an integer type with the specified width. More... | |
unsigned | getIntOrFloatBitWidth () |
bool | isIntOrIndex () |
Return true if this is an integer or index type. More... | |
bool | isIntOrIndexOrFloat () |
Return true if this is an integer, index, or float type. More... | |
bool | isIntOrFloat () |
Return true of this is an integer or a float type. More... | |
void | print (raw_ostream &os) |
Print the current type. More... | |
void | dump () |
unsigned | getSubclassData () const |
void | setSubclassData (unsigned val) |
const void * | getAsOpaquePointer () const |
Methods for supporting PointerLikeTypeTraits. More... | |
Static Public Member Functions | |
static bool | classof (Type) |
static Type | getFromOpaquePointer (const void *pointer) |
Protected Attributes | |
ImplType * | impl |
Friends | |
::llvm::hash_code | hash_value (Type arg) |
Instances of the Type class are immutable and uniqued. They wrap a pointer to the storage object owned by MLIRContext. Therefore, instances of Type are passed around by value.
Some types are "primitives" meaning they do not have any parameters, for example the Index type. Parametric types have additional information that differentiates the types of the same kind between them, for example the Integer type has bitwidth, making i8 and i16 belong to the same kind by be different instances of the IntegerType.
Types are constructed and uniqued via the 'detail::TypeUniquer' class.
Derived type classes are expected to implement several required implementation hooks:
Type storage objects inherit from TypeStorage and contain the following:
using mlir::Type::ImplType = TypeStorage |
using mlir::Type::TypeBase = detail::StorageUserBase<ConcreteType, BaseType, StorageType, detail::TypeUniquer> |
Utility class for implementing types.
enum mlir::Type::Kind |
Integer identifier for all the concrete type kinds. Note: This is not an enum class as each dialect will likely define a separate enumeration for the specific types that they define. Not being an enum class also simplifies the handling of type kinds by not requiring casts for each use.
Enumerator | |
---|---|
Function | |
Opaque | |
LAST_BUILTIN_TYPE | |
DEFINE_SYM_KIND_RANGE | |
DEFINE_SYM_KIND_RANGE |
|
inline |
|
inline |
|
default |
U mlir::Type::cast | ( | ) | const |
|
inlinestatic |
void Type::dump | ( | ) |
U mlir::Type::dyn_cast | ( | ) | const |
U mlir::Type::dyn_cast_or_null | ( | ) | const |
|
inline |
Methods for supporting PointerLikeTypeTraits.
MLIRContext * Type::getContext | ( | ) | const |
Return the LLVMContext in which this type was uniqued.
Dialect Type::getDialect | ( | ) | const |
Get the dialect this type is registered to.
|
inlinestatic |
unsigned Type::getIntOrFloatBitWidth | ( | ) |
Return the bit width of an integer or a float type, assert failure on other types.
unsigned Type::getKind | ( | ) | const |
Return the classification for this type.
unsigned Type::getSubclassData | ( | ) | const |
bool mlir::Type::isa | ( | ) | const |
bool Type::isBF16 | ( | ) |
bool Type::isF16 | ( | ) |
bool Type::isF32 | ( | ) |
bool Type::isF64 | ( | ) |
bool Type::isIndex | ( | ) |
bool Type::isInteger | ( | unsigned | width | ) |
Return true if this is an integer type with the specified width.
bool Type::isIntOrFloat | ( | ) |
Return true of this is an integer or a float type.
bool Type::isIntOrIndex | ( | ) |
Return true if this is an integer or index type.
bool Type::isIntOrIndexOrFloat | ( | ) |
Return true if this is an integer, index, or float type.
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
void Type::print | ( | raw_ostream & | os | ) |
Print the current type.
void Type::setSubclassData | ( | unsigned | val | ) |
|
friend |
|
protected |