diff options
| author | Lang Hames <lhames@gmail.com> | 2017-06-23 23:25:28 +0000 |
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2017-06-23 23:25:28 +0000 |
| commit | cd9d49b605cc0c3283bc6f2ad4c38f8e1a525e7d (patch) | |
| tree | de5c655184f5e9f11f2af90a3ab42d4ac10b6e1f /llvm/tools/lli/OrcLazyJIT.cpp | |
| parent | 7aacb659dad5ecdaa984406e0c6cc9a087f44e1b (diff) | |
| download | bcm5719-llvm-cd9d49b605cc0c3283bc6f2ad4c38f8e1a525e7d.tar.gz bcm5719-llvm-cd9d49b605cc0c3283bc6f2ad4c38f8e1a525e7d.zip | |
[ORC] Re-apply r306166 and r306168 with fix for regression test.
llvm-svn: 306182
Diffstat (limited to 'llvm/tools/lli/OrcLazyJIT.cpp')
| -rw-r--r-- | llvm/tools/lli/OrcLazyJIT.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/tools/lli/OrcLazyJIT.cpp b/llvm/tools/lli/OrcLazyJIT.cpp index 899a7acdb1c..2e15894152f 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::unique_ptr<Module> M) { return M; }; + return [](std::shared_ptr<Module> M) { return M; }; case DumpKind::DumpFuncsToStdOut: - return [](std::unique_ptr<Module> M) { + return [](std::shared_ptr<Module> M) { printf("[ "); for (const auto &F : *M) { @@ -76,7 +76,7 @@ OrcLazyJIT::TransformFtor OrcLazyJIT::createDebugDumper() { }; case DumpKind::DumpModsToStdOut: - return [](std::unique_ptr<Module> M) { + return [](std::shared_ptr<Module> M) { outs() << "----- Module Start -----\n" << *M << "----- Module End -----\n"; @@ -84,7 +84,7 @@ OrcLazyJIT::TransformFtor OrcLazyJIT::createDebugDumper() { }; case DumpKind::DumpModsToDisk: - return [](std::unique_ptr<Module> M) { + return [](std::shared_ptr<Module> M) { std::error_code EC; raw_fd_ostream Out(M->getModuleIdentifier() + ".ll", EC, sys::fs::F_Text); @@ -147,7 +147,8 @@ int llvm::runOrcLazyJIT(std::vector<std::unique_ptr<Module>> Ms, OrcInlineStubs); // Add the module, look up main and run it. - J.addModuleSet(std::move(Ms)); + for (auto &M : Ms) + J.addModule(std::shared_ptr<Module>(std::move(M))); auto MainSym = J.findSymbol("main"); if (!MainSym) { |

