X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=examples%2FKaleidoscope%2FOrc%2Ffully_lazy%2Ftoy.cpp;h=56123bb41e3612a3c956dc277229200e4c36650c;hb=88b2e585f3d03ba34bee8bb97d26d3ec85749be1;hp=f29a6f52f189d57913023e0fee24d524e2cf8db3;hpb=668fc94ea55a31c1971bd23a8f046b829a88fd14;p=oota-llvm.git diff --git a/examples/Kaleidoscope/Orc/fully_lazy/toy.cpp b/examples/Kaleidoscope/Orc/fully_lazy/toy.cpp index f29a6f52f18..56123bb41e3 100644 --- a/examples/Kaleidoscope/Orc/fully_lazy/toy.cpp +++ b/examples/Kaleidoscope/Orc/fully_lazy/toy.cpp @@ -20,7 +20,9 @@ #include #include #include + using namespace llvm; +using namespace llvm::orc; //===----------------------------------------------------------------------===// // Lexer @@ -684,7 +686,6 @@ public: LLVMContext& getLLVMContext() const { return Context; } void addPrototypeAST(std::unique_ptr P); PrototypeAST* getPrototypeAST(const std::string &Name); - std::map> FunctionDefs; private: typedef std::map> PrototypeMap; LLVMContext &Context; @@ -1236,7 +1237,7 @@ private: auto H = irGenStub(std::move(DefI->second)); // Remove the map entry now that we're done with it. - Session.FunctionDefs.erase(DefI); + FunctionDefs.erase(DefI); // Return the address of the stub. return findMangledSymbolIn(H, Name).getAddress(); @@ -1280,11 +1281,11 @@ private: // // The update action will update FunctionBodyPointer to point at the newly // compiled function. - CallbackInfo.setCompileAction( - [this, Fn = std::shared_ptr(std::move(FnAST))](){ - auto H = addModule(IRGen(Session, *Fn)); - return findSymbolIn(H, Fn->Proto->Name).getAddress(); - }); + std::shared_ptr 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)));