[LLVMdev] Hello World
felixcca at yahoo.ca
Thu Jun 24 12:16:53 PDT 2010
I've been watching LLVM since about a year now, and I thought it was finally time I'd do something with it. So I've got my hands dirty with a cool project (who knows? maybe I'll end up releasing it), but since I'm fairly new to the whole thing, there are still a number of things I'm not too sure about.
Also, I'd like to integrate C++ method calls to my jitted code. From what I've seen in the Kaleidoscope tutorial it's easy to use external C functions but there's nothing about C++ functions or methods. Problem is, since their names are mangled, it won't be as easy as C for C functions. What I was really looking for was a way to create a Function object from a function pointer. I think I understand why it can't be that simple (LLVM really needs a function name, and function pointers don't have that) so I've made a funny hack with dladdr to get the name of a method at runtime, but just in case I really missed something I'll ask you guys: is there a "standard", LLVM-backed way to make a Function object from a function or method with C++ linkage? (I know I could also make an extern "C" function to wrap the call, but that's not quite as fun).
Thanks for your help!
More information about the llvm-dev