[PATCH][llvm-c] Expose MC JIT
Filip Pizlo
fpizlo at apple.com
Fri Apr 12 16:49:05 PDT 2013
Revised patches included.
I added additional ruggedizing to the LLVMCreateMCJITCompilerForModule function, so that if it detects that the passed struct is larger than expected, it reports an error instead of continuing.
-Filip
On Apr 12, 2013, at 4:26 PM, Filip Pizlo <fpizlo at apple.com> wrote:
> Included are two patches that expose MCJIT via the C API:
>
> The first patch makes the MCJIT use the default JITMemoryManager if no memory manager is provided. This simplifies integration with the C API, which does not already expose a mechanism for supplying a custom memory manager.
>
> The second patch exposes the MCJIT via the C API, and also exposes the NoFramePointerElim option. The manner in which options are exposed is designed for forward compatibility; you supply an options struct along with a size which you zero-fill prior to manipulating. This is similar to the idiom I've seen used in other C APIs like BerkeleyDB. I considered having separate C function calls for each option, in the style of the ExecutionEngineBuilder API - but while that idiom feels right to me in C++, it feels less C-like. As well, the current options approach exposes not just parts of the Builder but also part of TargetOptions (namely, NoFramePointerElim). It's also more concise in practice.
>
> I plan to expose more innards through the LLVMMCJITCompilerOptions in the future. I'd be happy to do more of that in one go if that was preferred; but I thought that a baby step would be the best thing for now.
>
> <mcjit-default-allocator.patch><mcjit-llvm-c.patch>
>
> -Filip
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130412/075aa98e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcjit-default-allocator.patch
Type: application/octet-stream
Size: 603 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130412/075aa98e/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130412/075aa98e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcjit-llvm-c.patch
Type: application/octet-stream
Size: 4271 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130412/075aa98e/attachment-0001.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130412/075aa98e/attachment-0002.html>
More information about the llvm-commits
mailing list