26 typedef std::vector<std::pair<const Type *, std::map<uint32_t, uint32_t>>>
88 const std::map<uint32_t, uint32_t> &
129 friend std::ostream &
operator<<(std::ostream &Stream,
const Type *Ty);
132 static std::unique_ptr<Type>
136 static std::unique_ptr<Type>
getBool();
139 static std::unique_ptr<Type>
getFloat(uint32_t Width);
142 static std::unique_ptr<Type>
getInt(uint32_t Width);
145 static std::unique_ptr<Type>
147 const std::vector<const Type *> &ArgTypes);
150 static std::unique_ptr<Type>
getImage(
const Type *SampledType, uint32_t Dim,
155 static std::unique_ptr<Type>
getMatrix(
const Type *ColumnType,
156 uint32_t NumColumns);
159 static std::unique_ptr<Type>
173 static std::unique_ptr<Type>
181 static std::unique_ptr<Type>
getVoid();
bool Multisampled
Valid for image types.
static std::unique_ptr< Type > getVector(const Type *ElemType, uint32_t ElemCount)
Create a vector type.
bool isBool() const
Returns true if this is a bool type.
static std::unique_ptr< Type > getVoid()
Create a void type.
bool isScalar() const
Returns true if this is a scalar type.
uint32_t Depth
Valid for image types.
bool isFloat() const
Returns true if this is a floating point type.
uint32_t Sampled
Valid for image types.
bool Arrayed
Valid for image types.
static std::unique_ptr< Type > getPointer(uint32_t StorageClass, const Type *ElemType, uint32_t ArrayStride)
Create a pointer type.
size_t getSize() const
Returns the size of this type in bytes.
uint32_t StorageClass
Valid for pointer types.
std::vector< size_t > ElementOffsets
Valid for struct types.
static std::unique_ptr< Type > getSampledImage(const Type *ImageType)
Create a sampled image type.
std::vector< std::pair< const Type *, std::map< uint32_t, uint32_t > > > StructElementTypeList
A list of types used for structure members.
uint32_t BitWidth
Valid for integer and floating point types.
static std::unique_ptr< Type > getBool()
Create a boolean type.
bool isPointer() const
Returns true if this is a pointer type.
size_t getElementOffset(uint64_t Index) const
Returns the byte offset of the element at Index.
const Type * getElementType(uint64_t Index=0) const
Returns the type of the element at Index.
const Type * getScalarType() const
Returns the element type for vector types, or this for scalar types.
bool isInt() const
Returns true if this is an integer type.
static std::unique_ptr< Type > getSampler()
Create a sampler type.
static std::unique_ptr< Type > getImage(const Type *SampledType, uint32_t Dim, uint32_t Depth, bool Arrayed, bool MS, uint32_t Sampled, uint32_t Format)
Create an image type.
Type(TypeId Id, size_t ByteSize)
Create a new type.
bool isStruct() const
Returns true if this is a struct type.
bool isArray() const
Returns true if this is an array type.
bool isMatrix() const
Returns true if this is a matrix type.
uint32_t getDimensionality() const
Returns the dimensionality of an image type.
const Type * ReturnType
Valid for function types.
const std::map< uint32_t, uint32_t > & getStructMemberDecorations(uint32_t Index) const
Returns the decoration map for the structure member at Index.
uint32_t Dimensionality
Valid for image types.
uint32_t getElementCount() const
Returns the number of elements in this array, struct, or vector type.
std::vector< const Type * > ArgumentTypes
Valid for function types.
uint32_t ArrayStride
Valid for array and pointer types.
bool isComposite() const
Returns true if this is an array, struct, or vector type.
static std::unique_ptr< Type > getInt(uint32_t Width)
Create an integer type.
uint32_t getBitWidth() const
Returns the bit-width of this type.
uint32_t getStorageClass() const
Returns the storage class of this type.
TypeId
Identifiers that distinguish between different base types.
static std::unique_ptr< Type > getRuntimeArray(const Type *ElemType, uint32_t ArrayStride)
Create a runtime array type.
uint32_t Format
Valid for image types.
static std::unique_ptr< Type > getStruct(const StructElementTypeList &ElemTypes)
Create a structure type.
TypeId getTypeId() const
Returns the type ID of this type.
uint32_t ElementCount
Valid for composite types.
This class represents a SPIR-V type.
size_t ByteSize
The size of this type in bytes.
static std::unique_ptr< Type > getFunction(const Type *ReturnType, const std::vector< const Type * > &ArgTypes)
Create a function type.
bool isArrayedImage() const
Returns the Arrayed flag of an image type.
TypeId Id
The ID of this type.
const Type * ElementType
Valid for pointer and composite types.
static std::unique_ptr< Type > getFloat(uint32_t Width)
Create a floating point type.
static std::unique_ptr< Type > getArray(const Type *ElemType, uint32_t ElementCount, uint32_t ArrayStride)
Create an array type.
static std::unique_ptr< Type > getMatrix(const Type *ColumnType, uint32_t NumColumns)
Create a matrix type.
friend std::ostream & operator<<(std::ostream &Stream, const Type *Ty)
Allow a Type to be inserted into an output stream.
StructElementTypeList ElementTypes
Valid for struct types.
bool isVector() const
Returns true if this is a vector type.