18 #ifndef LLVM_IR_DERIVEDTYPES_H
19 #define LLVM_IR_DERIVEDTYPES_H
23 #include "llvm/Support/DataTypes.h"
30 template<
typename T>
class ArrayRef;
114 static bool isValidReturnType(
Type *RetTy);
118 static bool isValidArgumentType(
Type *ArgTy);
143 static_assert(AlignOf<FunctionType>::Alignment >= AlignOf<Type *>::Alignment,
144 "Alignment sufficient for objects appended to FunctionType");
157 Type *getTypeAtIndex(
unsigned Idx);
158 bool indexValid(
const Value *V)
const;
159 bool indexValid(
unsigned Idx)
const;
218 bool isPacked =
false);
223 bool isPacked =
false);
230 bool isPacked =
false);
274 static
bool isValidElementType(
Type *ElemTy);
337 uint64_t NumElements;
346 static ArrayType *
get(
Type *ElementType, uint64_t NumElements);
350 static bool isValidElementType(
Type *ElemTy);
363 unsigned NumElements;
380 assert(EltBits &&
"Element size must be of a non-zero size");
401 assert((EltBits & 1) == 0 &&
402 "Cannot truncate vector element with odd bit-width");
413 assert ((NumElts & 1) == 0 &&
414 "Cannot halve vector with odd number of elements.");
429 static bool isValidElementType(
Type *ElemTy);
437 return NumElements * getElementType()->getPrimitiveSizeInBits();
466 static bool isValidElementType(
Type *ElemTy);
469 static bool isLoadableOrStorableType(
Type *ElemTy);
CompositeType(LLVMContext &C, TypeID tid)
bool isOpaque() const
isOpaque - Return true if this is a type with an identity that has no body specified yet...
APInt getMask() const
For example, this is 0xFF for an 8 bit integer, 0xFFFF for i16, etc.
unsigned getNumParams() const
getNumParams - Return the number of fixed parameters this function type requires. ...
Type::subtype_iterator param_iterator
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
ArrayRef< Type * > params() const
static PointerType * get(Type *ElementType, unsigned AddressSpace)
PointerType::get - This constructs a pointer to an object of the specified type in a numbered address...
unsigned getAddressSpace() const
Return the address space of the Pointer type.
unsigned getBitWidth() const
Get the number of bits in this IntegerType.
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
static VectorType * getTruncatedElementVectorType(VectorType *VTy)
VectorType::getTruncatedElementVectorType - This static method is like getInteger except that the ele...
Type *const * ContainedTys
ContainedTys - A pointer to the array of Types contained by this Type.
SequentialType(TypeID TID, Type *ElType)
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
element_iterator element_end() const
Minimum number of bits that can be specified.
Type::subtype_iterator element_iterator
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
StructType - Class to represent struct types.
param_iterator param_end() const
uint64_t getSignBit() const
getSignBit - Return a uint64_t with just the most significant bit set (the sign bit, if the value is treated as a signed number).
unsigned getBitWidth() const
Return the number of bits in the Vector type.
bool isLiteral() const
isLiteral - Return true if this type is uniqued by structural equivalence, false if it is a struct de...
static StringRef getName(Value *V)
TypeID
Definitions of all of the base types for the Type system.
bool isSized(SmallPtrSetImpl< const Type * > *Visited=nullptr) const
isSized - Return true if it makes sense to take the size of this type.
FunctionType - Class to represent function types.
LLVMContext & getContext() const
getContext - Return the LLVMContext in which this type was uniqued.
ArrayRef< Type * > const elements() const
ArrayType - Class to represent array types.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
TypeID getTypeID() const
getTypeID - Return the type id for the type.
unsigned getNumElements() const
Return the number of elements in the Vector type.
unsigned getSubclassData() const
Type * getElementType() const
PointerType - Class to represent pointers.
10: Arbitrary bit width integers
Type * getParamType(unsigned i) const
Parameter type accessors.
static VectorType * getHalfElementsVectorType(VectorType *VTy)
VectorType::getHalfElementsVectorType - This static method returns a VectorType with half as many ele...
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
Type * getElementType(unsigned N) const
param_iterator param_begin() const
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
static VectorType * getInteger(VectorType *VTy)
VectorType::getInteger - This static method gets a VectorType with the same number of elements as the...
uint64_t getNumElements() const
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
Class to represent integer types.
static VectorType * getDoubleElementsVectorType(VectorType *VTy)
VectorType::getDoubleElementsVectorType - This static method returns a VectorType with twice as many ...
#define LLVM_END_WITH_NULL
SequentialType - This is the superclass of the array, pointer and vector type classes.
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
static PointerType * getUnqual(Type *ElementType)
PointerType::getUnqual - This constructs a pointer to an object of the specified type in the generic ...
15: SIMD 'packed' format, or other vector type
Type *const * subtype_iterator
bool hasName() const
hasName - Return true if this is a named struct that has a non-empty name.
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
Maximum number of bits that can be specified.
static VectorType * getExtendedElementVectorType(VectorType *VTy)
VectorType::getExtendedElementVectorType - This static method is like getInteger except that the elem...
Symbol info for RuntimeDyld.
VectorType - Class to represent vector types.
Class for arbitrary precision integers.
CompositeType - Common super class of ArrayType, StructType, PointerType and VectorType.
uint64_t getBitMask() const
getBitMask - Return a bitmask with ones set for all of the bits that can be set by an unsigned versio...
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
bool isPowerOf2ByteWidth() const
This method determines if the width of this IntegerType is a power-of-2 in terms of 8 bit bytes...
static bool classof(const Type *T)
Implement support type inquiry through isa, cast, and dyn_cast.
IntegerType(LLVMContext &C, unsigned NumBits)
void setSubclassData(unsigned val)
Type * getReturnType() const
unsigned getPrimitiveSizeInBits() const LLVM_READONLY
getPrimitiveSizeInBits - Return the basic size of this type if it is a primitive type.
LLVM Value Representation.
static VectorType * get(Type *ElementType, unsigned NumElements)
VectorType::get - This static method is the primary way to construct an VectorType.
StringRef - Represent a constant reference to a string, i.e.
unsigned getNumElements() const
Random access to the elements.
unsigned NumContainedTys
NumContainedTys - Keeps track of how many Type*'s there are in the ContainedTys list.