diff options
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/lli/OrcLazyJIT.cpp | 10 | ||||
-rw-r--r-- | llvm/tools/lli/OrcLazyJIT.h | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/llvm/tools/lli/OrcLazyJIT.cpp b/llvm/tools/lli/OrcLazyJIT.cpp index f1a752e0790..5624f70e12d 100644 --- a/llvm/tools/lli/OrcLazyJIT.cpp +++ b/llvm/tools/lli/OrcLazyJIT.cpp @@ -54,10 +54,10 @@ static cl::opt<bool> OrcInlineStubs("orc-lazy-inline-stubs", OrcLazyJIT::TransformFtor OrcLazyJIT::createDebugDumper() { switch (OrcDumpKind) { case DumpKind::NoDump: - return [](std::shared_ptr<Module> M) { return M; }; + return [](std::unique_ptr<Module> M) { return M; }; case DumpKind::DumpFuncsToStdOut: - return [](std::shared_ptr<Module> M) { + return [](std::unique_ptr<Module> M) { printf("[ "); for (const auto &F : *M) { @@ -76,7 +76,7 @@ OrcLazyJIT::TransformFtor OrcLazyJIT::createDebugDumper() { }; case DumpKind::DumpModsToStdOut: - return [](std::shared_ptr<Module> M) { + return [](std::unique_ptr<Module> M) { outs() << "----- Module Start -----\n" << *M << "----- Module End -----\n"; @@ -84,7 +84,7 @@ OrcLazyJIT::TransformFtor OrcLazyJIT::createDebugDumper() { }; case DumpKind::DumpModsToDisk: - return [](std::shared_ptr<Module> M) { + return [](std::unique_ptr<Module> M) { std::error_code EC; raw_fd_ostream Out(M->getModuleIdentifier() + ".ll", EC, sys::fs::F_Text); @@ -148,7 +148,7 @@ int llvm::runOrcLazyJIT(std::vector<std::unique_ptr<Module>> Ms, // Add the module, look up main and run it. for (auto &M : Ms) - cantFail(J.addModule(std::shared_ptr<Module>(std::move(M)))); + cantFail(J.addModule(std::move(M))); if (auto MainSym = J.findSymbol("main")) { typedef int (*MainFnPtr)(int, const char*[]); diff --git a/llvm/tools/lli/OrcLazyJIT.h b/llvm/tools/lli/OrcLazyJIT.h index 6b057c4d293..a9755b1abf5 100644 --- a/llvm/tools/lli/OrcLazyJIT.h +++ b/llvm/tools/lli/OrcLazyJIT.h @@ -51,7 +51,7 @@ public: using ObjLayerT = orc::RTDyldObjectLinkingLayer; using CompileLayerT = orc::IRCompileLayer<ObjLayerT, orc::SimpleCompiler>; using TransformFtor = - std::function<std::shared_ptr<Module>(std::shared_ptr<Module>)>; + std::function<std::unique_ptr<Module>(std::unique_ptr<Module>)>; using IRDumpLayerT = orc::IRTransformLayer<CompileLayerT, TransformFtor>; using CODLayerT = orc::CompileOnDemandLayer<IRDumpLayerT, CompileCallbackMgr>; using IndirectStubsManagerBuilder = CODLayerT::IndirectStubsManagerBuilderT; @@ -106,7 +106,7 @@ public: } } - Error addModule(std::shared_ptr<Module> M) { + Error addModule(std::unique_ptr<Module> M) { if (M->getDataLayout().isDefault()) M->setDataLayout(DL); |