From 4b546c91452c5735ada1430f8a6943328e4dba4e Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 6 Feb 2018 21:25:11 +0000 Subject: [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 ::addModule signatures from: Expected addModule(std::shared_ptr Mod, std::shared_ptr Resolver) to: Expected addModule(VModuleKey K, std::shared_ptr 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 --- llvm/lib/ExecutionEngine/Orc/Legacy.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'llvm/lib/ExecutionEngine/Orc/Legacy.cpp') 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("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(ErrorMsg, inconvertibleErrorCode())); + } if (Err) return std::move(Err); -- cgit v1.2.3