The root of the LLVM type system hierarchy.
Synopsis
Declared in <llvm/IR/Type.h>
class Type;
Description
The instances of the Type class are immutable: once they are created, they are never changed. Also note that only one instance of a particular type is ever created. Thus seeing if two types are equal is a matter of doing a trivial pointer comparison. To enforce that no two equal instances are created, Type instances can only be created via static factory methods in class Type and in derived classes. Once allocated, Types are never free'd.
Type Aliases
Name |
Description |
Iterator over this type's contained (subtype) types. |
|
Reverse iterator over contained (subtype) types. |
Enums
Name |
Description |
Identifiers for all base types in the LLVM type system. |
Member Functions
Name |
Description |
Return true if this type could be converted with a lossless BitCast to Ty. |
|
Return true if this type is or contains a target extension type that disallows being used as a global. |
|
Return true if this type is or contains a target extension type that disallows being used as a local. |
|
Dump this type to stderr for debugging. |
|
Return the element type of this array type. |
|
Return the number of elements in this array type. |
|
Return the bit width of this byte type (or of its scalar element). |
|
Return the type contained at index |
|
Return the LLVMContext in which this type was uniqued. |
|
Given scalar/vector integer type, returns a type with elements twice as wide as in the original type. For vectors, preserves element count. |
|
Return the width of the mantissa of this floating‐point type. |
|
Return the floating‐point semantics for this floating‐point type. |
|
Return the number of fixed parameters of this function type. |
|
Return the type of formal parameter |
|
Return the bit width of this integer type. |
|
Return the number of types in the derived type. |
|
Get the address space of this pointer or pointer vector type. |
|
Return the basic size of this type if it is a primitive type. |
|
If this is a vector type, return the getPrimitiveSizeInBits value for the element type. Otherwise return the getPrimitiveSizeInBits value for this type. |
|
If this is a vector type, return the element type, otherwise return 'this'. |
|
Return the type of element |
|
Return the name of this identified struct type. |
|
Return the number of elements in this struct type. |
|
Return the name of this target extension type. |
|
Given scalar/vector integer type, returns a type with elements half as wide as in the original type. For vectors, preserves element count. |
|
Return the type id for the type. This will return one of the TypeID enum elements defined above. |
|
Given an integer or vector type, change the lane bitwidth to NewBitwidth, whilst keeping the old number of lanes. |
|
Given vector type, change the element type, whilst keeping the old number of elements. For non‐vectors simply returns |
|
Return true if this is a 16‐bit float type. |
|
Return true if the type is an aggregate type. |
|
True if this is an instance of ArrayType. |
|
Return true if this is 'bfloat', a 16‐bit bfloat type. |
|
|
|
|
|
Return true if this is 'double', a 64‐bit IEEE fp type. |
|
Return true if this type is empty, that is, it has no elements or all of its elements are empty. |
|
Return true if this is 'fp128'. |
|
Return true if this is a FP type or a vector of FP. |
|
Return true if the type is "first class", meaning it is a valid type for a Value. |
|
Return true if this is 'float', a 32‐bit IEEE fp type. |
|
Return true if this is one of the floating‐point types. |
|
True if this is an instance of FunctionType. |
|
Return true if this function type is variadic. |
|
Return true if this is 'half', a 16‐bit IEEE fp type. |
|
Return true if this is a well‐behaved IEEE‐like type, which has a IEEE compatible layout, and does not have non‐IEEE values, such as x86_fp80's unnormal values. |
|
|
|
Return true if this is an integer type or a pointer type. |
|
|
|
Return true if this is 'label'. |
|
Return true if this is 'metadata'. |
|
Return true if this is a multi‐unit floating‐point type. |
|
Return true if this is powerpc long double. |
|
True if this is an instance of PointerType. |
|
Return true if this is a pointer type or a vector of pointer types. |
|
True if this is an instance of TargetExtType of RISC‐V vector tuple. |
|
Return true if this is a target extension type with a scalable layout. |
|
|
|
Return true if the type is a valid type for a register in codegen. This includes all first‐class types except struct and array types. |
|
Return true if it makes sense to take the size of this type. |
|
True if this is an instance of StructType. |
|
Return true if this is a target extension type. |
|
Returns true if this is 'token' or a token‐like target type.s |
|
Return true if this is 'token'. |
|
True if this is an instance of VectorType. |
|
Return true if this is 'void'. |
|
Return true if this is X86 AMX. |
|
Return true if this is x86 long double. |
|
Print the current type. |
|
Iterator to the first contained (subtype) type. |
|
Iterator past the last contained (subtype) type. |
|
Reverse iterator to the last contained (subtype) type. |
|
Reverse iterator past the first contained (subtype) type. |
|
Return an array view of this type's contained subtypes. |
Static Member Functions
Name |
Description |
Return the bfloat (16‐bit) floating‐point type. |
|
Return the 128‐bit byte type. |
|
Return the 16‐bit byte type for the given context. |
|
Return the 1‐bit byte type. |
|
Return the 32‐bit byte type for the given context. |
|
Return the 64‐bit byte type. |
|
Return the 8‐bit byte type. |
|
Returns a byte (vector of byte) type with the same size of an integer of the given integer (vector of integer) type. |
|
Return a byte type with bit width |
|
Return the IEEE double‐precision (64‐bit) floating‐point type. |
|
Return the 128‐bit IEEE floating‐point type (fp128). |
|
Return the IEEE single‐precision (32‐bit) floating‐point type. |
|
Return the floating‐point type matching semantics |
|
Return the IEEE half‐precision (16‐bit) floating‐point type. |
|
Return the 128‐bit integer type. |
|
Return the 16‐bit integer type. |
|
Return the 1‐bit integer type. |
|
Return the 32‐bit integer type. |
|
Return the 64‐bit integer type. |
|
Return the 8‐bit integer type. |
|
Returns an integer (vector of integer) type with the same size of a byte of the given byte (vector of byte) type. |
|
Return an integer type with bit width |
|
Return the label type. |
|
Return the metadata type used for metadata operands in the IR. |
|
Return the PowerPC double‐double (ppc_fp128) floating‐point type. |
|
Return a type based on an identifier. |
|
Return the LLVM scalar type corresponding to a C++ scalar type |
|
Return the token type. |
|
Return the void type. |
|
Return the WebAssembly externref target‐extension type. |
|
Return the WebAssembly funcref target‐extension type. |
|
Return the X86 AMX type for the given context. |
|
Return the x86 80‐bit extended‐precision floating‐point type. |
Protected Member Functions
Name |
Description |
|
Construct a uniqued primitive or placeholder type with id |
|
Destroy this type; types are never freed in practice. |
Return the subclass‐specific data packed into this type. |
|
Store subclass‐specific data into this type's SubclassData field. |
Protected Data Members
Name |
Description |
Pointer to the array of Types contained by this Type. |
|
Keeps track of how many Type*'s there are in the ContainedTys list. |
Friends
Name |
Description |
Private implementation details of |
Non-Member Functions
Name |
Description |
Compute the linearized index of a member in a nested aggregate. |
|
Compute the linearized index of a member in a nested aggregate/struct/array. |
|
Attempt to constant fold a getelementptr instruction with the specified operands. |
|
Returns true if |
|
Return |
|
Return a begin iterator over GEP indices from type |
|
Return an end iterator for GEP indices from operands |
|
Returns the types contained in |
|
Construct a low‐level type based on an LLVM type. |
|
Return the value type accessed by load or store instruction |
|
Returns the distance between compatible pointers |
|
Get the type back from LLT. It won't be 100 percent accurate but returns an estimate of the type. |
|
Returns the number of vector elements for a vectorized type. |
|
Returns true if |
|
Parse a type in the given string. |
|
Parse a type at the beginning of the given string. |
|
Given operands for a GetElementPtrInst, fold the result or return null. |
|
Convert a struct of vector types to a struct of scalar types. |
|
Convert a vectorized type to its scalarized (non‐vector) form. |
|
Convert a scalar type to a vector type. |
|
Convert a scalar type to a fixed‐length vector type. |
|
Convert a struct of scalar types to a struct of vector types. |
|
Convert a scalar or struct type to its vectorized form. |
|
Unwrap an array of opaque |
|
C API conversion helpers for |
|
C API conversion helpers for |
|
Wrap an array of |
|
Returns true if this is a type legal for the 'nofpclass' attribute. This follows the same type rules as FPMathOperator. |
|
Return the mask of attributes incompatible with type |
|
Match a value of a specific type, capturing it if we match. |
|
Match any value of a specific type. |
|
Match a const value of a specific type, capturing it if we match. |
|
Match a value of a specific type. |
|
This function determines whether a value for the pointer LoadPtr can be extracted from the load at DepLI. |
|
This function determines whether a value for the pointer LoadPtr can be extracted from the memory intrinsic at DepMI. |
|
This function determines whether a value for the pointer LoadPtr can be extracted from the store at DepSI. |
|
Populate a small list of potentially interesting constants of a given type. |
|
Return a small list of potentially interesting constants of a given type. |
|
Converts a scalar or vector LLVM type to its DXIL element type. |
Derived Classes
Name |
Description |
Class to represent array types. |
|
Class to represent byte types. |
|
Class to represent function types. |
|
Class to represent integer types. |
|
Class to represent pointers. |
|
Class to represent struct types. There are two different kinds of struct types: Literal structs and Identified structs. |
|
Class to represent target extensions types, which are generally unintrospectable from target‐independent optimizations. |
|
A typed pointer type used by some GPU targets. |
|
Base class of all SIMD vector types |
Created with MrDocs