1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[examples] Update LLJITWithJITLink example for change in c0143f37dab.

This commit is contained in:
Lang Hames 2019-12-15 20:24:17 -08:00
parent 50bcd0d170
commit 8738e4fc81

View File

@ -38,20 +38,18 @@ int main(int argc, char *argv[]) {
cl::ParseCommandLineOptions(argc, argv, "HowToUseLLJIT");
ExitOnErr.setBanner(std::string(argv[0]) + ": ");
// Define an in-process JITLink memory manager.
jitlink::InProcessMemoryManager MemMgr;
// Detect the host and set code model to small.
auto JTMB = ExitOnErr(JITTargetMachineBuilder::detectHost());
JTMB.setCodeModel(CodeModel::Small);
// Create an LLJIT instance with an ObjectLinkingLayer as the base layer.
auto J =
ExitOnErr(LLJITBuilder()
auto J = ExitOnErr(
LLJITBuilder()
.setJITTargetMachineBuilder(std::move(JTMB))
.setObjectLinkingLayerCreator([&](ExecutionSession &ES,
const Triple &TT) {
return std::make_unique<ObjectLinkingLayer>(ES, MemMgr);
.setObjectLinkingLayerCreator(
[&](ExecutionSession &ES, const Triple &TT) {
return std::make_unique<ObjectLinkingLayer>(
ES, std::make_unique<jitlink::InProcessMemoryManager>());
})
.create());