[orcjit] Include CMake support for the fully_lazy example and fix the build
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 19 Feb 2015 19:06:04 +0000 (19:06 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 19 Feb 2015 19:06:04 +0000 (19:06 +0000)
Not sure if/how to make the CMake build use C++14 for the examples, so
let's stick to C++11 for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229888 91177308-0d34-0410-b5e6-96231b3b80d8

examples/Kaleidoscope/Orc/CMakeLists.txt
examples/Kaleidoscope/Orc/fully_lazy/CMakeLists.txt
examples/Kaleidoscope/Orc/fully_lazy/toy.cpp

index e4cf0c2aa1bdc8f203398bc526fe55ab22d7fdd5..5aa04543dc68757bf2d31a94fbdf228d6ffe2388 100644 (file)
@@ -1,3 +1,4 @@
 add_subdirectory(initial)
 add_subdirectory(lazy_codegen)
 add_subdirectory(lazy_irgen)
+add_subdirectory(fully_lazy)
index 44886818e0f0a37fbc4538fca171f91bb7571ee1..abb0428a152ea81fc13fd6e825ec10dd21457b29 100644 (file)
@@ -2,11 +2,12 @@ set(LLVM_LINK_COMPONENTS
   Core
   ExecutionEngine
   Object
+  OrcJIT
   RuntimeDyld
   Support
   native
   )
 
-add_kaleidoscope_chapter(Kaleidoscope-Orc-lazy_irgen
+add_kaleidoscope_chapter(Kaleidoscope-Orc-fully_lazy
   toy.cpp
   )
index f29a6f52f189d57913023e0fee24d524e2cf8db3..b1aca7803da577dfc6496a1e79ac33dccb0c6c9f 100644 (file)
@@ -1280,11 +1280,11 @@ private:
     //
     //   The update action will update FunctionBodyPointer to point at the newly
     // compiled function.
-    CallbackInfo.setCompileAction(
-      [this, Fn = std::shared_ptr<FunctionAST>(std::move(FnAST))](){
-        auto H = addModule(IRGen(Session, *Fn));
-        return findSymbolIn(H, Fn->Proto->Name).getAddress();
-      });
+    std::shared_ptr<FunctionAST> Fn = std::move(FnAST);
+    CallbackInfo.setCompileAction([this, Fn]() {
+      auto H = addModule(IRGen(Session, *Fn));
+      return findSymbolIn(H, Fn->Proto->Name).getAddress();
+    });
     CallbackInfo.setUpdateAction(
       CompileCallbacks.getLocalFPUpdater(H, Mangle(BodyPtrName)));