<div dir="ltr">Hi Per,<div><br></div><div>It doesn't look like there's any way to do this with the existing C-API. I suspect this isn't an issue for the FTL developers as they resolve most (perhaps all?) of their symbols at the IR level.</div><div><br></div><div>I think it would be possible to extend the C-API to support symbol resolution callbacks: We could add a new variant of the LLVMCreateSimpleMCJITMemoryManager function which also takes a symbol resolution callback.</div><div><br></div><div>Cheers,</div><div>Lang.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 24, 2015 at 3:17 AM, Per Mildner <span dir="ltr"><<a href="mailto:Per.Mildner@sics.se" target="_blank">Per.Mildner@sics.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am trying to port the Kaleidoscope tutorials to use the C API.<br>
<br>
This worked up to part 3, but the code for part 4 (where MCJIT support is added), creates a custom memory manager, in C++, that is then added with setMCJITMemoryManager().<br>
<br>
The custom memory manager is used in order to resolve references from a module to symbols outside the module, e.g. to symbols representing code jitted in other modules.<br>
<br>
So, how can I hook the way MCJIT resolves out-of-module references, using only the C API? Alternatively, is there some other way to handle cross module references?<br>
<br>
I briefly looked at the WebKit FTL code. They (mostly) use the C API but I could not see how symbol references were handled.<br>
<br>
(I use the C API because the surrounding application is written in C, so adding my own C wrappers for unexposed functionality is not an attractive option.)<br>
<br>
Thanks in advance,<br>
<br>
<br>
Per Mildner<br>
<a href="mailto:Per.Mildner@sics.se">Per.Mildner@sics.se</a><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div>