[llvm] 073df42 - [examples] Update LLJITWithJITLink example for change in c0143f37dab.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 15 21:57:59 PST 2019


Author: Lang Hames
Date: 2019-12-15T21:57:10-08:00
New Revision: 073df421e0d7caf3ba3b2fd163cbb29251162f57

URL: https://github.com/llvm/llvm-project/commit/073df421e0d7caf3ba3b2fd163cbb29251162f57
DIFF: https://github.com/llvm/llvm-project/commit/073df421e0d7caf3ba3b2fd163cbb29251162f57.diff

LOG: [examples] Update LLJITWithJITLink example for change in c0143f37dab.

Added: 
    

Modified: 
    llvm/examples/LLJITExamples/LLJITWithJITLink/LLJITWithJITLink.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/examples/LLJITExamples/LLJITWithJITLink/LLJITWithJITLink.cpp b/llvm/examples/LLJITExamples/LLJITWithJITLink/LLJITWithJITLink.cpp
index fdda31eca487..ff8ccfa983c2 100644
--- a/llvm/examples/LLJITExamples/LLJITWithJITLink/LLJITWithJITLink.cpp
+++ b/llvm/examples/LLJITExamples/LLJITWithJITLink/LLJITWithJITLink.cpp
@@ -38,22 +38,20 @@ 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()
-                    .setJITTargetMachineBuilder(std::move(JTMB))
-                    .setObjectLinkingLayerCreator([&](ExecutionSession &ES,
-                                                      const Triple &TT) {
-                      return std::make_unique<ObjectLinkingLayer>(ES, MemMgr);
-                    })
-                    .create());
+  auto J = ExitOnErr(
+      LLJITBuilder()
+          .setJITTargetMachineBuilder(std::move(JTMB))
+          .setObjectLinkingLayerCreator(
+              [&](ExecutionSession &ES, const Triple &TT) {
+                return std::make_unique<ObjectLinkingLayer>(
+                    ES, std::make_unique<jitlink::InProcessMemoryManager>());
+              })
+          .create());
 
   auto M = ExitOnErr(parseExampleModule(Add1Example, "add1"));
 


        


More information about the llvm-commits mailing list