Skip to content

Commit 073df42

Browse files
committed
[examples] Update LLJITWithJITLink example for change in c0143f3.
1 parent d28c6d5 commit 073df42

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

llvm/examples/LLJITExamples/LLJITWithJITLink/LLJITWithJITLink.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,20 @@ int main(int argc, char *argv[]) {
3838
cl::ParseCommandLineOptions(argc, argv, "HowToUseLLJIT");
3939
ExitOnErr.setBanner(std::string(argv[0]) + ": ");
4040

41-
// Define an in-process JITLink memory manager.
42-
jitlink::InProcessMemoryManager MemMgr;
43-
4441
// Detect the host and set code model to small.
4542
auto JTMB = ExitOnErr(JITTargetMachineBuilder::detectHost());
4643
JTMB.setCodeModel(CodeModel::Small);
4744

4845
// Create an LLJIT instance with an ObjectLinkingLayer as the base layer.
49-
auto J =
50-
ExitOnErr(LLJITBuilder()
51-
.setJITTargetMachineBuilder(std::move(JTMB))
52-
.setObjectLinkingLayerCreator([&](ExecutionSession &ES,
53-
const Triple &TT) {
54-
return std::make_unique<ObjectLinkingLayer>(ES, MemMgr);
55-
})
56-
.create());
46+
auto J = ExitOnErr(
47+
LLJITBuilder()
48+
.setJITTargetMachineBuilder(std::move(JTMB))
49+
.setObjectLinkingLayerCreator(
50+
[&](ExecutionSession &ES, const Triple &TT) {
51+
return std::make_unique<ObjectLinkingLayer>(
52+
ES, std::make_unique<jitlink::InProcessMemoryManager>());
53+
})
54+
.create());
5755

5856
auto M = ExitOnErr(parseExampleModule(Add1Example, "add1"));
5957

0 commit comments

Comments
 (0)