Type

The Type class for the IR library of LLVM. Instances of the Type class are immutable.

For more informations about the Type Class, you can read the LLVM documentation for Type.

getVoidTy

Return an instance of a Void Type (builtin type that is always available).

static Type *getVoidTy(LLVMContext &C);

IntegerType

Class to represent integer types. Note that this class is also used to represent the built-in integer types: Int1Ty, Int8Ty, Int16Ty, Int32Ty and Int64Ty. Integer representation type, it inherits from Type class.

More about the class IntegerType class.

class IntegerType : public Type{...};

getInt32Ty

Int32Ty is the instance of an IntegerType. Return the instance of Int32 Type (builtin type that is always available).

static IntegerType *getInt32Ty(LLVMContext &C);

PointerType

Class to represent pointers, inherits from Type class. More about the class PointerType class.

class PointerType : public Type{...};

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);

getInt32PtrTy

Convenience method for getting pointer type with the builtin type Int32 as pointee.

AS corresponding to AddrSpace, is optional.

static IntegerType *getInt32PtrTy(LLVMContext &C, unsigned AS = 0);

getInt8PtrTy

Convenience method for getting pointer type with the builtin type Int8 as pointee.

AS corresponding to AddrSpace, is optional.

static PointerType *getInt8PtrTy(LLVMContext &C, unsigned AS = 0);

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 uniqued. They can not be recursive. Identified Struct are not uniqued, 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 class StructType class.

class StructType : public Type{...};

StructType::create

This creates an identified struct.

static StructType *create(LLVMContext &Context);

FunctionType

Class to represent function types. It inherits from Type Class. More about the class FunctionType class.

class FunctionType : public Type{...};

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);