18 #ifndef LLVM_IR_DERIVEDTYPES_H
19 #define LLVM_IR_DERIVEDTYPES_H
117 static bool isValidReturnType(
Type *RetTy);
120 static bool isValidArgumentType(
Type *ArgTy);
144 static_assert(
alignof(FunctionType) >=
alignof(
Type *),
145 "Alignment sufficient for objects appended to FunctionType");
148 return cast<FunctionType>(
this)->isVarArg();
152 return cast<FunctionType>(
this)->getParamType(i);
156 return cast<FunctionType>(
this)->getNumParams();
166 Type *getTypeAtIndex(
const Value *V)
const;
167 Type *getTypeAtIndex(
unsigned Idx)
const;
168 bool indexValid(
const Value *V)
const;
169 bool indexValid(
unsigned Idx)
const;
226 bool isPacked =
false);
235 bool isPacked =
false);
286 bool isLayoutIdentical(
StructType *Other)
const;
302 return cast<StructType>(
this)->
getName();
306 return cast<StructType>(
this)->getNumElements();
310 return cast<StructType>(
this)->getElementType(N);
321 uint64_t NumElements;
326 NumElements(NumElements) {
353 static ArrayType *
get(
Type *ElementType, uint64_t NumElements);
365 return cast<ArrayType>(
this)->getNumElements();
384 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");
411 assert ((NumElts & 1) == 0 &&
412 "Cannot halve vector with odd number of elements.");
429 return getNumElements() * getElementType()->getPrimitiveSizeInBits();
439 return cast<VectorType>(
this)->getNumElements();
468 static bool isLoadableOrStorableType(
Type *ElemTy);
480 return cast<PointerType>(
getScalarType())->getAddressSpace();
485 #endif // LLVM_IR_DERIVEDTYPES_H
Maximum number of bits that can be specified.
CompositeType(LLVMContext &C, TypeID tid)
Minimum number of bits that can be specified.
bool isOpaque() const
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 getStructNumElements() const
unsigned getNumParams() const
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)
This constructs a pointer to an object of the specified type in a numbered address space...
unsigned getAddressSpace() const
Return the address space of the Pointer type.
unsigned getBitWidth() const
Get the number of bits in this IntegerType.
SequentialType(TypeID TID, Type *ElType, uint64_t NumElements)
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
Type * getElementType() const
static VectorType * getTruncatedElementVectorType(VectorType *VTy)
This static method is like getInteger except that the element types are half as wide as the elements ...
Type * getFunctionParamType(unsigned i) const
Type *const * ContainedTys
A pointer to the array of Types contained by this Type.
uint64_t getArrayNumElements() const
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
element_iterator element_end() const
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.
Class to represent struct types.
param_iterator param_end() const
uint64_t getSignBit() const
Return a uint64_t with just the most significant bit set (the sign bit, if the value is treated as a ...
unsigned getBitWidth() const
Return the number of bits in the Vector type.
bool isLiteral() const
Return true if this type is uniqued by structural equivalence, false if it is a struct definition...
static StringRef getName(Value *V)
TypeID
Definitions of all of the base types for the Type system.
Class to represent function types.
Type * getStructElementType(unsigned N) const
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
ArrayRef< Type * > const elements() const
Class to represent array types.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
TypeID getTypeID() const
Return the type id for the type.
unsigned getSubclassData() const
Type(LLVMContext &C, TypeID tid)
Type * getScalarType() const LLVM_READONLY
If this is a vector type, return the element type, otherwise return 'this'.
Type * getElementType() const
Class to represent pointers.
11: Arbitrary bit width integers
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
Type * getParamType(unsigned i) const
Parameter type accessors.
static VectorType * getHalfElementsVectorType(VectorType *VTy)
This static method returns a VectorType with half as many elements as the input type and the same 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)
This static method gets a VectorType with the same number of elements as the input type...
uint64_t getNumElements() const
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
bool isFunctionVarArg() const
unsigned getIntegerBitWidth() const
Class to represent integer types.
static VectorType * getDoubleElementsVectorType(VectorType *VTy)
This static method returns a VectorType with twice as many elements as the input type and the same el...
#define LLVM_END_WITH_NULL
This is the superclass of the array 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)
This constructs a pointer to an object of the specified type in the generic address space (address sp...
16: SIMD 'packed' format, or other vector type
Type *const * subtype_iterator
bool hasName() const
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.
StringRef getStructName() const
static VectorType * getExtendedElementVectorType(VectorType *VTy)
This static method is like getInteger except that the element types are twice as wide as the elements...
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
Symbol info for RuntimeDyld.
Class to represent vector types.
Class for arbitrary precision integers.
unsigned getVectorNumElements() const
Common super class of ArrayType, StructType and VectorType.
uint64_t getBitMask() const
Return a bitmask with ones set for all of the bits that can be set by an unsigned version of this typ...
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
unsigned getFunctionNumParams() const
static bool isValidElementType(Type *Ty)
Predicate for the element types that the SLP vectorizer supports.
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
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
unsigned getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
LLVM Value Representation.
static VectorType * get(Type *ElementType, unsigned NumElements)
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 getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
unsigned NumContainedTys
Keeps track of how many Type*'s there are in the ContainedTys list.