title: Can I bind an existing method to a LLVM Function* and use it from JIT-compiled code?
body: <p>I'm toying around with the LLVM C++ API. I'd like to JIT compile code and run it.</p>
  
  <p>However, I need to call a C++ method from said JIT-compiled code. Normally, LLVM treats method calls as function calls with the object pointer passed as the first argument, so calling shouldn't be a problem. The real problem is to get that function into LLVM.</p>
  
  <p>As far as I can see, it's possible to use external linkage for functions and get it by its name. Problem is, since it's a C++ method, its name is going to be mangled, so I don't think it's a good idea to go that way.</p>
  
  <p>Making the <code>FunctionType</code> object is easy enough. But from there, how can I inform LLVM of my method and get a <code>Function</code> object for it?</p>