summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Orc/Legacy.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2018-02-06 21:25:11 +0000
committerLang Hames <lhames@gmail.com>2018-02-06 21:25:11 +0000
commit4b546c91452c5735ada1430f8a6943328e4dba4e (patch)
tree633421ee6cc4d06fce9ce73f625992e7dbedc6fe /llvm/lib/ExecutionEngine/Orc/Legacy.cpp
parentffe72034a6d688efcd7035fe9caf5964f00037c0 (diff)
downloadbcm5719-llvm-4b546c91452c5735ada1430f8a6943328e4dba4e.tar.gz
bcm5719-llvm-4b546c91452c5735ada1430f8a6943328e4dba4e.zip
[ORC] Start migrating ORC layers to use the new ORC Core.h APIs.
In particular this patch switches RTDyldObjectLinkingLayer to use orc::SymbolResolver and threads the requried changse (ExecutionSession references and VModuleKeys) through the existing layer APIs. The purpose of the new resolver interface is to improve query performance and better support parallelism, both in JIT'd code and within the compiler itself. The most visibile change is switch of the <Layer>::addModule signatures from: Expected<Handle> addModule(std::shared_ptr<ModuleType> Mod, std::shared_ptr<JITSymbolResolver> Resolver) to: Expected<Handle> addModule(VModuleKey K, std::shared_ptr<ModuleType> Mod); Typical usage of addModule will now look like: auto K = ES.allocateVModuleKey(); Resolvers[K] = createSymbolResolver(...); Layer.addModule(K, std::move(Mod)); See the BuildingAJIT tutorial code for example usage. llvm-svn: 324405
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/Legacy.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Orc/Legacy.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/Legacy.cpp b/llvm/lib/ExecutionEngine/Orc/Legacy.cpp
index 7a11b94c7cf..240e0f8ba1d 100644
--- a/llvm/lib/ExecutionEngine/Orc/Legacy.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Legacy.cpp
@@ -45,10 +45,21 @@ JITSymbolResolverAdapter::lookup(const LookupSet &Symbols) {
auto UnresolvedSymbols = R.lookup(Query, InternedSymbols);
- if (!UnresolvedSymbols.empty())
- Err = joinErrors(std::move(Err),
- make_error<StringError>("Unresolved symbols",
- inconvertibleErrorCode()));
+ if (!UnresolvedSymbols.empty()) {
+ std::string ErrorMsg = "Unresolved symbols: ";
+
+ ErrorMsg += **UnresolvedSymbols.begin();
+ for (auto I = std::next(UnresolvedSymbols.begin()),
+ E = UnresolvedSymbols.end();
+ I != E; ++I) {
+ ErrorMsg += ", ";
+ ErrorMsg += **I;
+ }
+
+ Err =
+ joinErrors(std::move(Err),
+ make_error<StringError>(ErrorMsg, inconvertibleErrorCode()));
+ }
if (Err)
return std::move(Err);
OpenPOWER on IntegriCloud