diff options
| author | Lang Hames <lhames@gmail.com> | 2015-04-15 18:26:24 +0000 |
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2015-04-15 18:26:24 +0000 |
| commit | 66aa00f9047d2e55db9b55adfd7b25fdfa3890fa (patch) | |
| tree | a875e075e1837f67ac9b4b04464a86628ae781c5 /llvm/tools | |
| parent | 6e3b5d40fca1cfd1362b6654e2c2ff6c31465039 (diff) | |
| download | bcm5719-llvm-66aa00f9047d2e55db9b55adfd7b25fdfa3890fa.tar.gz bcm5719-llvm-66aa00f9047d2e55db9b55adfd7b25fdfa3890fa.zip | |
[Orc] Refactor the CompileOnDemandLayer to make its addModuleSet method
signature match the other layers.
This makes it possible to compose other layers (e.g. IRTransformLayer) on top
of CompileOnDemandLayer.
llvm-svn: 235029
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/lli/OrcLazyJIT.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/llvm/tools/lli/OrcLazyJIT.h b/llvm/tools/lli/OrcLazyJIT.h index 3f89f6a5168..2b2db6e668c 100644 --- a/llvm/tools/lli/OrcLazyJIT.h +++ b/llvm/tools/lli/OrcLazyJIT.h @@ -92,25 +92,28 @@ public: // 1) Search the JIT symbols. // 2) Check for C++ runtime overrides. // 3) Search the host process (LLI)'s symbol table. - auto FallbackLookup = - [this](const std::string &Name) { + auto Resolver = + orc::createLambdaResolver( + [this](const std::string &Name) { - if (auto Sym = CODLayer.findSymbol(Name, true)) - return RuntimeDyld::SymbolInfo(Sym.getAddress(), Sym.getFlags()); + if (auto Sym = CODLayer.findSymbol(Name, true)) + return RuntimeDyld::SymbolInfo(Sym.getAddress(), Sym.getFlags()); - if (auto Sym = CXXRuntimeOverrides.searchOverrides(Name)) - return Sym; + if (auto Sym = CXXRuntimeOverrides.searchOverrides(Name)) + return Sym; - if (auto Addr = RTDyldMemoryManager::getSymbolAddressInProcess(Name)) - return RuntimeDyld::SymbolInfo(Addr, JITSymbolFlags::Exported); + if (auto Addr = RTDyldMemoryManager::getSymbolAddressInProcess(Name)) + return RuntimeDyld::SymbolInfo(Addr, JITSymbolFlags::Exported); - return RuntimeDyld::SymbolInfo(nullptr); - }; + return RuntimeDyld::SymbolInfo(nullptr); + }, + [](const std::string &Name) { return RuntimeDyld::SymbolInfo(nullptr); } + ); // Add the module to the JIT. std::vector<std::unique_ptr<Module>> S; S.push_back(std::move(M)); - auto H = CODLayer.addModuleSet(std::move(S), std::move(FallbackLookup)); + auto H = CODLayer.addModuleSet(std::move(S), nullptr, std::move(Resolver)); // Run the static constructors, and save the static destructor runner for // execution when the JIT is torn down. |

