search for: cbfptrty

Displaying 2 results from an estimated 2 matches for "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 = cast<Function>(M->getOrInsertFunction(fName, Type::getInt32Ty(C), cbFPtrTy, Type::getInt8PtrTy(C), (Type *)0)); But then I get an error form LLVM : /home/salomon/AppSRC/LLVM/release_28/lib/VMCore/Type.cpp:456:...
2010 Nov 29
0
[LLVMdev] FunctionType as a function argument
...ould 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 = cast<Function>(M->getOrInsertFunction(fName, > Type::getInt32Ty(C), cbFPtrTy, Type::getInt8PtrTy(C), (Type *)0)); > > But then I get an error form LLVM : > /home/salomon/AppSRC/LLVM/release...