[llvm-branch-commits] [llvm] 95b63c7 - [ORC] Move LookupRequest from OrcShared to Orc.

Lang Hames via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 19 01:28:44 PST 2021


Author: Lang Hames
Date: 2021-01-19T20:23:47+11:00
New Revision: 95b63c7b139449b2d4084e986ca3f5bfde46b50c

URL: https://github.com/llvm/llvm-project/commit/95b63c7b139449b2d4084e986ca3f5bfde46b50c
DIFF: https://github.com/llvm/llvm-project/commit/95b63c7b139449b2d4084e986ca3f5bfde46b50c.diff

LOG: [ORC] Move LookupRequest from OrcShared to Orc.

It depends on Orc types (SymbolLookupSet), so can't be part of OrcShared.

Added: 
    

Modified: 
    llvm/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h
    llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
    llvm/include/llvm/ExecutionEngine/Orc/TargetProcessControl.h
    llvm/lib/ExecutionEngine/Orc/TPCDynamicLibrarySearchGenerator.cpp
    llvm/lib/ExecutionEngine/Orc/TargetProcessControl.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h b/llvm/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h
index 1097ae67b2a2..a8aa42799115 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h
@@ -309,7 +309,7 @@ class OrcRPCTargetProcessControlBase : public TargetProcessControl {
   }
 
   Expected<std::vector<tpctypes::LookupResult>>
-  lookupSymbols(ArrayRef<tpctypes::LookupRequest> Request) override {
+  lookupSymbols(ArrayRef<LookupRequest> Request) override {
     std::vector<orcrpctpc::RemoteLookupRequest> RR;
     for (auto &E : Request) {
       RR.push_back({});

diff  --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
index f43b9299c045..d01b3ef21f80 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
@@ -17,7 +17,6 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ExecutionEngine/JITSymbol.h"
-#include "llvm/ExecutionEngine/Orc/Core.h"
 
 #include <vector>
 
@@ -60,14 +59,6 @@ struct BufferWrite {
 /// A handle used to represent a loaded dylib in the target process.
 using DylibHandle = JITTargetAddress;
 
-/// A pair of a dylib and a set of symbols to be looked up.
-struct LookupRequest {
-  LookupRequest(DylibHandle Handle, const SymbolLookupSet &Symbols)
-      : Handle(Handle), Symbols(Symbols) {}
-  DylibHandle Handle;
-  const SymbolLookupSet &Symbols;
-};
-
 using LookupResult = std::vector<JITTargetAddress>;
 
 /// Either a uint8_t array or a uint8_t*.

diff  --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcessControl.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcessControl.h
index 504a5ea0f9e9..b60b1ca6e372 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcessControl.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcessControl.h
@@ -90,6 +90,14 @@ class TargetProcessControl {
     }
   };
 
+  /// A pair of a dylib and a set of symbols to be looked up.
+  struct LookupRequest {
+    LookupRequest(tpctypes::DylibHandle Handle, const SymbolLookupSet &Symbols)
+        : Handle(Handle), Symbols(Symbols) {}
+    tpctypes::DylibHandle Handle;
+    const SymbolLookupSet &Symbols;
+  };
+
   virtual ~TargetProcessControl();
 
   /// Intern a symbol name in the SymbolStringPool.
@@ -123,7 +131,7 @@ class TargetProcessControl {
   /// symbol is not found then it be assigned a '0' value in the result.
   /// that correspond to the lookup order.
   virtual Expected<std::vector<tpctypes::LookupResult>>
-  lookupSymbols(ArrayRef<tpctypes::LookupRequest> Request) = 0;
+  lookupSymbols(ArrayRef<LookupRequest> Request) = 0;
 
   /// Run function with a main-like signature.
   virtual Expected<int32_t> runAsMain(JITTargetAddress MainFnAddr,
@@ -172,7 +180,7 @@ class SelfTargetProcessControl : public TargetProcessControl,
   Expected<tpctypes::DylibHandle> loadDylib(const char *DylibPath) override;
 
   Expected<std::vector<tpctypes::LookupResult>>
-  lookupSymbols(ArrayRef<tpctypes::LookupRequest> Request) override;
+  lookupSymbols(ArrayRef<LookupRequest> Request) override;
 
   Expected<int32_t> runAsMain(JITTargetAddress MainFnAddr,
                               ArrayRef<std::string> Args) override;

diff  --git a/llvm/lib/ExecutionEngine/Orc/TPCDynamicLibrarySearchGenerator.cpp b/llvm/lib/ExecutionEngine/Orc/TPCDynamicLibrarySearchGenerator.cpp
index 3442da5810cb..bbf3ada1d4ba 100644
--- a/llvm/lib/ExecutionEngine/Orc/TPCDynamicLibrarySearchGenerator.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TPCDynamicLibrarySearchGenerator.cpp
@@ -41,7 +41,7 @@ Error TPCDynamicLibrarySearchGenerator::tryToGenerate(
 
   SymbolMap NewSymbols;
 
-  tpctypes::LookupRequest Request(H, LookupSymbols);
+  TargetProcessControl::LookupRequest Request(H, LookupSymbols);
   auto Result = TPC.lookupSymbols(Request);
   if (!Result)
     return Result.takeError();

diff  --git a/llvm/lib/ExecutionEngine/Orc/TargetProcessControl.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcessControl.cpp
index c607ce4d91af..7bf874e88c26 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcessControl.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcessControl.cpp
@@ -65,8 +65,7 @@ SelfTargetProcessControl::loadDylib(const char *DylibPath) {
 }
 
 Expected<std::vector<tpctypes::LookupResult>>
-SelfTargetProcessControl::lookupSymbols(
-    ArrayRef<tpctypes::LookupRequest> Request) {
+SelfTargetProcessControl::lookupSymbols(ArrayRef<LookupRequest> Request) {
   std::vector<tpctypes::LookupResult> R;
 
   for (auto &Elem : Request) {


        


More information about the llvm-branch-commits mailing list