[llvm] 4bb18a8 - [ORC] Add missing std::moves, pass SymbolLookupSet by value.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 10:51:29 PDT 2022


Author: Lang Hames
Date: 2022-05-19T10:51:20-07:00
New Revision: 4bb18a89c418082c3b1e9d16fde40fbc915d17e5

URL: https://github.com/llvm/llvm-project/commit/4bb18a89c418082c3b1e9d16fde40fbc915d17e5
DIFF: https://github.com/llvm/llvm-project/commit/4bb18a89c418082c3b1e9d16fde40fbc915d17e5.diff

LOG: [ORC] Add missing std::moves, pass SymbolLookupSet by value.

Avoids some unnecessary SymbolStringPtr copies.

Added: 
    

Modified: 
    llvm/include/llvm/ExecutionEngine/Orc/Core.h
    llvm/lib/ExecutionEngine/Orc/Core.cpp
    llvm/lib/ExecutionEngine/Orc/LookupAndRecordAddrs.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ExecutionEngine/Orc/Core.h b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
index d525914200a13..b3c85b53eda3a 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Core.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
@@ -1523,7 +1523,7 @@ class ExecutionSession {
   /// after resolution, the function will return a success value, but the
   /// error will be reported via reportErrors.
   Expected<SymbolMap> lookup(const JITDylibSearchOrder &SearchOrder,
-                             const SymbolLookupSet &Symbols,
+                             SymbolLookupSet Symbols,
                              LookupKind K = LookupKind::Static,
                              SymbolState RequiredState = SymbolState::Ready,
                              RegisterDependenciesFunction RegisterDependencies =

diff  --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp
index 7514b242d0c00..7467de3c15934 100644
--- a/llvm/lib/ExecutionEngine/Orc/Core.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp
@@ -2070,7 +2070,7 @@ void ExecutionSession::lookup(
 
 Expected<SymbolMap>
 ExecutionSession::lookup(const JITDylibSearchOrder &SearchOrder,
-                         const SymbolLookupSet &Symbols, LookupKind K,
+                         SymbolLookupSet Symbols, LookupKind K,
                          SymbolState RequiredState,
                          RegisterDependenciesFunction RegisterDependencies) {
 #if LLVM_ENABLE_THREADS
@@ -2102,7 +2102,7 @@ ExecutionSession::lookup(const JITDylibSearchOrder &SearchOrder,
 #endif
 
   // Perform the asynchronous lookup.
-  lookup(K, SearchOrder, Symbols, RequiredState, NotifyComplete,
+  lookup(K, SearchOrder, std::move(Symbols), RequiredState, NotifyComplete,
          RegisterDependencies);
 
 #if LLVM_ENABLE_THREADS

diff  --git a/llvm/lib/ExecutionEngine/Orc/LookupAndRecordAddrs.cpp b/llvm/lib/ExecutionEngine/Orc/LookupAndRecordAddrs.cpp
index 44cb78c773c9f..3452267e4df4c 100644
--- a/llvm/lib/ExecutionEngine/Orc/LookupAndRecordAddrs.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/LookupAndRecordAddrs.cpp
@@ -24,7 +24,7 @@ void lookupAndRecordAddrs(
     Symbols.add(KV.first, LookupFlags);
 
   ES.lookup(
-      K, SearchOrder, Symbols, SymbolState::Ready,
+      K, SearchOrder, std::move(Symbols), SymbolState::Ready,
       [Pairs = std::move(Pairs),
        OnRec = std::move(OnRecorded)](Expected<SymbolMap> Result) mutable {
         if (!Result)
@@ -47,7 +47,7 @@ Error lookupAndRecordAddrs(
   std::promise<MSVCPError> ResultP;
   auto ResultF = ResultP.get_future();
   lookupAndRecordAddrs([&](Error Err) { ResultP.set_value(std::move(Err)); },
-                       ES, K, SearchOrder, Pairs, LookupFlags);
+                       ES, K, SearchOrder, std::move(Pairs), LookupFlags);
   return ResultF.get();
 }
 


        


More information about the llvm-commits mailing list