Displaying 2 results from an estimated 2 matches for "cbfptrti".
Did you mean:
cbfptrty
2010 Nov 29
3
[LLVMdev] FunctionType as a function argument
Hi all.
I would like to declare a function that takes a function pointer as an
argument.
In C, it would be :
void execute(char (*func)(void*), void *param)
So, in my compiler, I have :
std::vector<const Type *> cbFPtrArgs(1, Type::getInt8PtrTy(C));
FunctionType * cbFPtrTy = FunctionType::get(Type::getInt8Ty(C), cbFPtrArgs,
false);
Function * func =
2010 Nov 29
0
[LLVMdev] FunctionType as a function argument
You need a pointer-to-function type, but FunctionType just gives you a
function type. Use PointerType::getUnqual(FunctionType::get(...)). Or
TypeBuilder<char (*func)(void*), false>::get(context) from
Support/TypeBuilder.h.
On Mon, Nov 29, 2010 at 10:37 AM, Salomon Brys <salomon.brys at gmail.com>wrote:
> Hi all.
> I would like to declare a function that takes a function pointer