How can I pass a pointer to function to another function? I have a function like this:
std::string PRINT_STATE_NAME(pPrintState func);
where pPrintState is a typedef like this:
typedef void (*pPrintState)(std::string* buffer);
So I JITed pPrintState and have its llvm::FunctionType available.
Next I want to call PRINT_STATE_NAME() as defined above from llvm C++ API. Unfortunately I can't figure out what parameter to pass to the call instruction. Atm I made an llvm::GlobalVariable with inner type of converted pPrintState. But what should I pass as initializer? Or am I completely on the wrong track here? Any help is appreciated! Thanks!