If you mean i8** (pointer to a pointer to i8 ), then:
If you need a pointer to a function that returns nothing and accepts i8* , then:
// This creates the i8* type PointerType* PointerTy = PointerType::get(IntegerType::get(mod->getContext(), 8), 0); // Create a function type. Its argument types are passed as a vector std::vector<Type*>FuncTy_args; FuncTy_args.push_back(PointerTy); // one argument: char* FunctionType* FuncTy = FunctionType::get( /*Result=*/Type::getVoidTy(mod->getContext()), // returning void /*Params=*/FuncTy_args, // taking those args /*isVarArg=*/false); // Finally this is the pointer to the function type described above PointerType* PtrToFuncTy = PointerType::get(FuncTy, 0);
A more general answer: you can use the LLVM C ++ API backend to create the C ++ code needed to create any kind of IR. This can be done with the LLVM online demo - http://llvm.org/demo/ - this is how I created the code for this answer.
source share