[ORC] Pass Symbols to ExecutionSession::lookup by value, potentially saving a
authorLang Hames <lhames@gmail.com>
Mon, 1 Oct 2018 04:59:10 +0000 (04:59 +0000)
committerLang Hames <lhames@gmail.com>
Mon, 1 Oct 2018 04:59:10 +0000 (04:59 +0000)
copy.

llvm-svn: 343442

llvm/include/llvm/ExecutionEngine/Orc/Core.h
llvm/lib/ExecutionEngine/Orc/Core.cpp

index 50c73ab..24742b1 100644 (file)
@@ -740,7 +740,7 @@ public:
   /// dependenant symbols for this query (e.g. it is being made by a top level
   /// client to get an address to call) then the value NoDependenciesToRegister
   /// can be used.
-  void lookup(const JITDylibList &JDs, const SymbolNameSet &Symbols,
+  void lookup(const JITDylibList &JDs, SymbolNameSet Symbols,
               SymbolsResolvedCallback OnResolve, SymbolsReadyCallback OnReady,
               RegisterDependenciesFunction RegisterDependencies);
 
index 34cfe02..b44427d 100644 (file)
@@ -1628,7 +1628,7 @@ Expected<SymbolMap> ExecutionSession::legacyLookup(
 }
 
 void ExecutionSession::lookup(
-    const JITDylibList &JDs, const SymbolNameSet &Symbols,
+    const JITDylibList &JDs, SymbolNameSet Symbols,
     SymbolsResolvedCallback OnResolve, SymbolsReadyCallback OnReady,
     RegisterDependenciesFunction RegisterDependencies) {
 
@@ -1640,7 +1640,7 @@ void ExecutionSession::lookup(
   auto Unresolved = std::move(Symbols);
   std::map<JITDylib *, MaterializationUnitList> MUsMap;
   auto Q = std::make_shared<AsynchronousSymbolQuery>(
-      Symbols, std::move(OnResolve), std::move(OnReady));
+      Unresolved, std::move(OnResolve), std::move(OnReady));
   bool QueryIsFullyResolved = false;
   bool QueryIsFullyReady = false;
   bool QueryFailed = false;