A function is a GlobalValue, so it is a pointer in itself. In the meantime, you can use the LLVM C ++ backend to generate C ++ API calls that recreate the IR that you submit to llc.
For example, feed the following code at http://llvm.org/demo :
void foo(int (*bar)(int)); int factorial(int X); int main(int argc, char **argv) { foo(factorial); }
Make sure that the βShow LLVM C ++ API Codeβ checkbox is selected, and you will see the corresponding LLVM IR and ++ C API calls, which will create it again.
source share