]> granicus.if.org Git - llvm/commit
[examples] Add an example of how to use JITLink and small-code-model with LLJIT.
authorLang Hames <lhames@gmail.com>
Fri, 18 Oct 2019 18:25:15 +0000 (18:25 +0000)
committerLang Hames <lhames@gmail.com>
Fri, 18 Oct 2019 18:25:15 +0000 (18:25 +0000)
commit90696971b2a4677279b1ebfcaf15ac89f82fefeb
treee18f9bda14b2881d3fe409f4f3c79bc8345f0d3d
parent0a8dc0861b81dd671df55a2835aef6df2ca8da5f
[examples] Add an example of how to use JITLink and small-code-model with LLJIT.

JITLink is LLVM's newer jit-linker. It is an alternative to (and hopefully
eventually a replacement for) LLVM's older jit-linker, RuntimeDyld. Unlike
RuntimeDyld which requries JIT'd code to be complied with the large code
model, JITlink can link code compiled with the small code model, which is
the native code model for a number of targets (including all supported MachO
targets).

This example shows how to:

-- Create a JITLink InProcessMemoryManager
-- Set the code model to small
-- Use a JITLink backed ObjectLinkingLayer as the linking layer for LLJIT
   (rather than the default RTDyldObjectLinkingLayer).

Note: This example will only work on platforms supported by JITLink. As of
this commit that's MachO/x86-64 and MachO/arm64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375266 91177308-0d34-0410-b5e6-96231b3b80d8
examples/LLJITExamples/CMakeLists.txt
examples/LLJITExamples/LLJITWithJITLink/CMakeLists.txt [new file with mode: 0644]
examples/LLJITExamples/LLJITWithJITLink/LLJITWithJITLink.cpp [new file with mode: 0644]