15 #ifndef LLVM_IR_TYPE_H
16 #define LLVM_IR_TYPE_H
23 #include "llvm/Support/DataTypes.h"
33 class LLVMContextImpl;
35 template<
class GraphType>
struct GraphTraits;
83 unsigned SubclassData : 24;
124 bool NoDetails =
false)
const;
266 return isSizedDerivedType(Visited);
466 return reinterpret_cast<Type**
>(Tys);
static Type * getDoubleTy(LLVMContext &C)
static IntegerType * getInt1Ty(LLVMContext &C)
unsigned getStructNumElements() const
2: 32-bit floating point type
Type * getSequentialElementType() const
static PointerType * getInt32PtrTy(LLVMContext &C, unsigned AS=0)
bool isDoubleTy() const
Return true if this is 'double', a 64-bit IEEE fp type.
bool isTokenTy() const
Return true if this is 'token'.
bool isPtrOrPtrVectorTy() const
Return true if this is a pointer type or a vector of pointer types.
int getFPMantissaWidth() const
Return the width of the mantissa of this type.
4: 80-bit floating point type (X87)
subtype_reverse_iterator subtype_rend() const
1: 16-bit floating point type
static IntegerType * getInt64Ty(LLVMContext &C)
static Type * getMetadataTy(LLVMContext &C)
static IntegerType * getInt16Ty(LLVMContext &C)
static Type * getX86_MMXTy(LLVMContext &C)
static PointerType * getX86_MMXPtrTy(LLVMContext &C, unsigned AS=0)
subtype_iterator subtype_end() const
Type * getFunctionParamType(unsigned i) const
static PointerType * getInt64PtrTy(LLVMContext &C, unsigned AS=0)
static Type * getX86_FP80Ty(LLVMContext &C)
Type *const * ContainedTys
A pointer to the array of Types contained by this Type.
Type * getPointerElementType() const
uint64_t getArrayNumElements() const
static bool isSequentialType(TypeID TyID)
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
bool isSingleValueType() const
Return true if the type is a valid type for a register in codegen.
static Type * getTokenTy(LLVMContext &C)
static const fltSemantics & x87DoubleExtended()
Attribute unwrap(LLVMAttributeRef Attr)
static Type * getFloatTy(LLVMContext &C)
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
Type * getArrayElementType() const
bool canLosslesslyBitCastTo(Type *Ty) const
Return true if this type could be converted with a lossless BitCast to type 'Ty'. ...
TypeID
Definitions of all of the base types for the Type system.
static PointerType * getInt16PtrTy(LLVMContext &C, unsigned AS=0)
Type * getVectorElementType() const
static Type * getPPC_FP128Ty(LLVMContext &C)
#define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref)
struct LLVMOpaqueType * LLVMTypeRef
Each value in the LLVM IR has a type, an LLVMTypeRef.
static Type * getLabelTy(LLVMContext &C)
Type * getStructElementType(unsigned N) const
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
bool isHalfTy() const
Return true if this is 'half', a 16-bit IEEE fp type.
static bool doit(const Type &Ty)
static PointerType * getDoublePtrTy(LLVMContext &C, unsigned AS=0)
bool isFirstClassType() const
Return true if the type is "first class", meaning it is a valid type for a Value. ...
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.
bool isFloatingPointTy() const
Return true if this is one of the six floating-point types.
bool isArrayTy() const
True if this is an instance of ArrayType.
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'.
bool isPPC_FP128Ty() const
Return true if this is powerpc long double.
Class to represent pointers.
static const fltSemantics & IEEEsingle()
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.
static ChildIteratorType child_end(NodeRef N)
static ChildIteratorType child_begin(NodeRef N)
bool isX86_MMXTy() const
Return true if this is X86 MMX.
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
static IntegerType * getInt128Ty(LLVMContext &C)
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.
bool isVectorTy() const
True if this is an instance of VectorType.
Type * getContainedType(unsigned i) const
This method is used to implement the type iterator (defined at the end of the file).
static NodeRef getEntryNode(Type *T)
bool isFloatTy() const
Return true if this is 'float', a 32-bit IEEE fp type.
static const fltSemantics & IEEEhalf()
This file declares a class to represent arbitrary precision floating point values and provide a varie...
static Type * getVoidTy(LLVMContext &C)
void print(raw_ostream &O, bool IsForDebug=false, bool NoDetails=false) const
Print the current type.
6: 128-bit floating point type (two 64-bits, PowerPC)
bool isFunctionVarArg() const
unsigned getIntegerBitWidth() const
Class to represent integer types.
Type::subtype_iterator ChildIteratorType
static PointerType * getPPC_FP128PtrTy(LLVMContext &C, unsigned AS=0)
Type::subtype_iterator ChildIteratorType
unsigned getNumContainedTypes() const
Return the number of types in the derived type.
bool isFP128Ty() const
Return true if this is 'fp128'.
bool isPointerTy() const
True if this is an instance of PointerType.
static const fltSemantics & IEEEquad()
static PointerType * getFloatPtrTy(LLVMContext &C, unsigned AS=0)
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
static PointerType * getInt8PtrTy(LLVMContext &C, unsigned AS=0)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static Type * getFP128Ty(LLVMContext &C)
static PointerType * getX86_FP80PtrTy(LLVMContext &C, unsigned AS=0)
static Type * getHalfTy(LLVMContext &C)
static PointerType * getInt1PtrTy(LLVMContext &C, unsigned AS=0)
bool isFunctionTy() const
True if this is an instance of FunctionType.
static ChildIteratorType child_end(NodeRef N)
16: SIMD 'packed' format, or other vector type
unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type...
Type *const * subtype_iterator
StringRef getStructName() const
static IntegerType * getIntNTy(LLVMContext &C, unsigned N)
static PointerType * getHalfPtrTy(LLVMContext &C, unsigned AS=0)
static Type * getPrimitiveType(LLVMContext &C, TypeID IDNumber)
Return a type based on an identifier.
const fltSemantics & getFltSemantics() const
static PointerType * getFP128PtrTy(LLVMContext &C, unsigned AS=0)
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
bool isIntegerTy() const
True if this is an instance of IntegerType.
unsigned getVectorNumElements() const
static const fltSemantics & IEEEdouble()
bool isStructTy() const
True if this is an instance of StructType.
unsigned getFunctionNumParams() const
bool isX86_FP80Ty() const
Return true if this is x86 long double.
LLVMAttributeRef wrap(Attribute Attr)
bool isAggregateType() const
Return true if the type is an aggregate type.
static IntegerType * getInt32Ty(LLVMContext &C)
static ChildIteratorType child_begin(NodeRef N)
static const fltSemantics & PPCDoubleDouble()
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
static PointerType * getIntNPtrTy(LLVMContext &C, unsigned N, unsigned AS=0)
3: 64-bit floating point type
void setSubclassData(unsigned val)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isEmptyTy() const
Return true if this type is empty, that is, it has no elements or all of its elements are empty...
static NodeRef getEntryNode(NodeRef T)
unsigned getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
bool isLabelTy() const
Return true if this is 'label'.
This class implements an extremely fast bulk output stream that can only output to a stream...
std::reverse_iterator< subtype_iterator > subtype_reverse_iterator
PointerType * getPointerTo(unsigned AddrSpace=0) const
Return a pointer to the current type.
StringRef - Represent a constant reference to a string, i.e.
9: MMX vectors (64 bits, X86 specific)
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
subtype_reverse_iterator subtype_rbegin() const
static IntegerType * getInt8Ty(LLVMContext &C)
unsigned NumContainedTys
Keeps track of how many Type*'s there are in the ContainedTys list.
subtype_iterator subtype_begin() const
ArrayRef< Type * > subtypes() const
bool isVoidTy() const
Return true if this is 'void'.
5: 128-bit floating point type (112-bit mantissa)
bool isMetadataTy() const
Return true if this is 'metadata'.