Go to the documentation of this file.
13 #ifndef LLVM_EXECUTIONENGINE_ORC_SIMPLEREMOTEEPC_H
14 #define LLVM_EXECUTIONENGINE_ORC_SIMPLEREMOTEEPC_H
49 template <
typename TransportT,
typename... TransportTCtorArgTs>
52 TransportTCtorArgTs &&...TransportTCtorArgs) {
53 std::unique_ptr<SimpleRemoteEPC> SREPC(
56 auto T = TransportT::Create(
57 *SREPC, std::forward<TransportTCtorArgTs>(TransportTCtorArgs)...);
81 IncomingWFRHandler OnComplete,
94 std::unique_ptr<TaskDispatcher>
D)
111 void handleCallWrapper(
uint64_t RemoteSeqNo, ExecutorAddr TagAddr,
115 uint64_t getNextSeqNo() {
return NextSeqNo++; }
116 void releaseSeqNo(
uint64_t SeqNo) {}
118 using PendingCallWrapperResultsMap =
119 DenseMap<uint64_t, IncomingWFRHandler>;
121 std::mutex SimpleRemoteEPCMutex;
122 std::condition_variable DisconnectCV;
123 bool Disconnected =
false;
126 std::unique_ptr<SimpleRemoteEPCTransport> T;
127 std::unique_ptr<jitlink::JITLinkMemoryManager> OwnedMemMgr;
128 std::unique_ptr<MemoryAccess> OwnedMemAccess;
130 std::unique_ptr<EPCGenericDylibManager> DylibMgr;
131 ExecutorAddr RunAsMainAddr;
134 PendingCallWrapperResultsMap PendingCallWrapperResults;
140 #endif // LLVM_EXECUTIONENGINE_ORC_SIMPLEREMOTEEPC_H
Represents an address in the executor process.
This is an optimization pass for GlobalISel generic memory operations.
Expected< HandleMessageAction > handleMessage(SimpleRemoteEPCOpcode OpC, uint64_t SeqNo, ExecutorAddr TagAddr, SimpleRemoteEPCArgBytesVector ArgBytes) override
Handle receipt of a message.
A setup object containing callbacks to construct a memory manager and memory access object.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
static ErrorSuccess success()
Create a success value.
ExecutorProcessControl supports interaction with a JIT target process.
std::shared_ptr< SymbolStringPool > SSP
Expected< std::unique_ptr< jitlink::JITLinkMemoryManager > >(SimpleRemoteEPC &) CreateMemoryManagerFn
Tagged union holding either a T or a Error.
void handleDisconnect(Error Err) override
Handle a disconnection from the underlying transport.
SimpleRemoteEPC(const SimpleRemoteEPC &)=delete
SimpleRemoteEPC & operator=(const SimpleRemoteEPC &)=delete
void callWrapperAsync(ExecutorAddr WrapperFnAddr, IncomingWFRHandler OnComplete, ArrayRef< char > ArgBuffer) override
Run a wrapper function in the executor.
Error disconnect() override
Disconnect from the target process.
unique_function< CreateMemoryManagerFn > CreateMemoryManager
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
unique_function< CreateMemoryAccessFn > CreateMemoryAccess
Error joinErrors(Error E1, Error E2)
Concatenate errors.
Expected< tpctypes::DylibHandle > loadDylib(const char *DylibPath) override
Load the dynamic library at the given path and return a handle to it.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
SmallVector< char, 128 > SimpleRemoteEPCArgBytesVector
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Lightweight error class with error context and mandatory checking.
std::unique_ptr< TaskDispatcher > D
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
static Expected< std::unique_ptr< SimpleRemoteEPC > > Create(std::unique_ptr< TaskDispatcher > D, Setup S, TransportTCtorArgTs &&...TransportTCtorArgs)
Create a SimpleRemoteEPC using the given transport type and args.
Expected< int32_t > runAsMain(ExecutorAddr MainFnAddr, ArrayRef< std::string > Args) override
Run function with a main-like signature.
Expected< std::vector< tpctypes::LookupResult > > lookupSymbols(ArrayRef< LookupRequest > Request) override
Search for symbols in the target process.