Type
Type Class for the IR library of LLVM. Instances of the Type class are immutable.
For more information about the Type Class, you can read the LLVM documentation for Type.
llvm::Type::getVoidTy
Return an instance of a
Void
Type (builtin type that is always available).Warning
You should pay extra attention when handling void type. See Expressions for detailed examples.
- Do not forget that:
a variable can hold a void value (that are represented using an integer in LLVM)
void values can be compared
a procedure has a void return type
static Type* getVoidTy(LLVMContext &C);
llvm::IntegerType
Class to represent integer types. Note that this class is also used to represent the built-in integer types:
Int1Ty
,Int8Ty
,Int16Ty
,Int32Ty
andInt64Ty
. Integer representation type, it inherits fromType
class.More about the IntegerType Class.
class IntegerType : public Type { ... };
llvm::Type::getInt32Ty
Int32Ty
is the instance of anIntegerType
. Return the instance ofInt32
Type (builtin type that is always available).static IntegerType* getInt32Ty(LLVMContext &C);
llvm::Type::getInt8Ty
Int8Ty
is the instance of anIntegerType
. Return the instance ofInt8
Type (builtin type that is always available).static IntegerType* getInt8Ty(LLVMContext &C);
llvm::PointerType
Class to represent pointers, inherits from
Type
class. More about the PointerType Class.class PointerType : public Type { ... };
llvm::PointerType::getUnqual
This constructs a pointer to an object of the specified type in the generic address space (address space zero).
static PointerType* getUnqual(Type* ElementType);
llvm::PointerType::get
This constructs a pointer to an object of the specified type in a numbered address space.
static PointerType* get(Type* ElementType, unsigned AddressSpace);
llvm::StructType
- Class to represent struct types. There are two different kinds of structs:
Literal structs and Identified structs.
Literal Struct must have a body when they are created, and are unique.
They can not be recursive. Identified
Struct
are not unique, they are managed by LLVMContext.For more information about literal and identified structs you can go check out LLVM Documentation about Structure Type.
It inherits from
Type
class.More about the StructType Class.
class StructType : public Type { ... };
llvm::StructType::create
This creates an identified struct.
static StructType* create(LLVMContext &Context);
llvm::FunctionType
Class to represent function types. It inherits from
Type
Class. More about the FunctionType Class.class FunctionType : public Type {...};
llvm::FunctionType::get
This static method is the primary way of constructing a
FunctionType
.
Result
represents the type for the return value of the function.
Params
represents the parameters of the function.
isVarArg
true if the function takes a variable number of arguments.static FunctionType* get(Type* Result, ArrayRef<Type*> Params, bool isVarArg);