diff options
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/LLJIT.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/Orc/LLJIT.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp index c6532c60fb8..a80f78afe80 100644 --- a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp +++ b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp @@ -132,7 +132,9 @@ LLJIT::LLJIT(LLJITBuilderState &S, Error &Err) CompileThreads = std::make_unique<ThreadPool>(S.NumCompileThreads); ES->setDispatchMaterialization( [this](JITDylib &JD, std::unique_ptr<MaterializationUnit> MU) { - auto Work = [MU = std::move(MU), &JD] { MU->doMaterialize(JD); }; + // FIXME: Switch to move capture once we have c++14. + auto SharedMU = std::shared_ptr<MaterializationUnit>(std::move(MU)); + auto Work = [SharedMU, &JD]() { SharedMU->doMaterialize(JD); }; CompileThreads->async(std::move(Work)); }); } |