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
VoidType (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,Int32TyandInt64Ty. Integer representation type, it inherits fromTypeclass.More about the IntegerType Class.
class IntegerType : public Type { ... };
llvm::Type::getInt32Ty
Int32Tyis the instance of anIntegerType. Return the instance ofInt32Type (builtin type that is always available).static IntegerType* getInt32Ty(LLVMContext &C);
llvm::Type::getInt8Ty
Int8Tyis the instance of anIntegerType. Return the instance ofInt8Type (builtin type that is always available).static IntegerType* getInt8Ty(LLVMContext &C);
llvm::PointerType
Class to represent pointers, inherits from
Typeclass. More about the PointerType Class.class PointerType : public Type { ... };
llvm::PointerType::getUnqualThis 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::getThis 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
Structare 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
Typeclass.More about the StructType Class.
class StructType : public Type { ... };
llvm::StructType::createThis creates an identified struct.
static StructType* create(LLVMContext &Context);
llvm::FunctionType
Class to represent function types. It inherits from
TypeClass. More about the FunctionType Class.class FunctionType : public Type {...};
llvm::FunctionType::getThis static method is the primary way of constructing a
FunctionType.
Resultrepresents the type for the return value of the function.
Paramsrepresents the parameters of the function.
isVarArgtrue if the function takes a variable number of arguments.static FunctionType* get(Type* Result, ArrayRef<Type*> Params, bool isVarArg);