[LLVMdev] Passing a function pointer as parameter to function call?
hxy9243 at gmail.com
Thu Mar 12 15:00:29 PDT 2015
I'm writing an LLVM pass, and I want to insert a call instruction that
takes a function pointer as a parameter. The effect would be the same as
Where foo is a function I insert with M.getOrInsertFunction(), which in
LLVM is a Function class.
I searched for a while and did not come up with a satisfying answer. Should
I create a Value class of pointer type, or a Int64Ty for a pointer? How do
I get the pointer to the function I create? I also tried passing foo as
Function* in LLVM as parameter to create CallInst directly, and I doesn't
seem to work.
Any hints and enlightenment is appreciated. Many thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev