18#ifndef LLVM_EXECUTIONENGINE_ORC_EPCGENERICMEMORYACCESS_H
19#define LLVM_EXECUTIONENGINE_ORC_EPCGENERICMEMORYACCESS_H
72 return std::move(Err);
73 return std::make_unique<EPCGenericMemoryAccess>(ES, std::move(Fns));
79 : ES(ES), Fns(
std::
move(Fns)) {}
83 Fns.WriteUInt8s(std::move(OnWriteComplete), ES, Ws);
88 Fns.WriteUInt16s(std::move(OnWriteComplete), ES, Ws);
93 Fns.WriteUInt32s(std::move(OnWriteComplete), ES, Ws);
98 Fns.WriteUInt64s(std::move(OnWriteComplete), ES, Ws);
103 Fns.WritePointers(std::move(OnWriteComplete), ES, Ws);
108 Fns.WriteBuffers(std::move(OnWriteComplete), ES, Ws);
113 Fns.ReadUInt8s(std::move(OnComplete), ES, Rs);
118 Fns.ReadUInt16s(std::move(OnComplete), ES, Rs);
123 Fns.ReadUInt32s(std::move(OnComplete), ES, Rs);
128 Fns.ReadUInt64s(std::move(OnComplete), ES, Rs);
133 Fns.ReadPointers(std::move(OnComplete), ES, Rs);
138 Fns.ReadBuffers(std::move(OnComplete), ES, Rs);
143 Fns.ReadStrings(std::move(OnComplete), ES, Rs);
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Tagged union holding either a T or a Error.
void readUInt8sAsync(ArrayRef< ExecutorAddr > Rs, OnReadUIntsCompleteFn< uint8_t > OnComplete) override
void readUInt32sAsync(ArrayRef< ExecutorAddr > Rs, OnReadUIntsCompleteFn< uint32_t > OnComplete) override
void writeUInt16sAsync(ArrayRef< tpctypes::UInt16Write > Ws, WriteResultFn OnWriteComplete) override
void readStringsAsync(ArrayRef< ExecutorAddr > Rs, OnReadStringsCompleteFn OnComplete) override
void readUInt16sAsync(ArrayRef< ExecutorAddr > Rs, OnReadUIntsCompleteFn< uint16_t > OnComplete) override
void readBuffersAsync(ArrayRef< ExecutorAddrRange > Rs, OnReadBuffersCompleteFn OnComplete) override
void writeUInt32sAsync(ArrayRef< tpctypes::UInt32Write > Ws, WriteResultFn OnWriteComplete) override
static Expected< std::unique_ptr< MemoryAccess > > Create(ExecutionSession &ES)
Create an EPCGenericMemoryAccess instance that reaches the memory-access wrappers in ES's bootstrap J...
void writeUInt64sAsync(ArrayRef< tpctypes::UInt64Write > Ws, WriteResultFn OnWriteComplete) override
void writePointersAsync(ArrayRef< tpctypes::PointerWrite > Ws, WriteResultFn OnWriteComplete) override
void readUInt64sAsync(ArrayRef< ExecutorAddr > Rs, OnReadUIntsCompleteFn< uint64_t > OnComplete) override
EPCGenericMemoryAccess(ExecutionSession &ES, Funcs Fns)
Create an EPCGenericMemoryAccess instance from a given set of memory access proxies.
void readPointersAsync(ArrayRef< ExecutorAddr > Rs, OnReadPointersCompleteFn OnComplete) override
void writeUInt8sAsync(ArrayRef< tpctypes::UInt8Write > Ws, WriteResultFn OnWriteComplete) override
void writeBuffersAsync(ArrayRef< tpctypes::BufferWrite > Ws, WriteResultFn OnWriteComplete) override
An ExecutionSession represents a running JIT program.
APIs for manipulating memory in the target process.
unique_function< void(Expected< ReadStringsResult >)> OnReadStringsCompleteFn
unique_function< void(Expected< ReadBuffersResult >)> OnReadBuffersCompleteFn
unique_function< void(Expected< ReadPointersResult >)> OnReadPointersCompleteFn
unique_function< void(Error)> WriteResultFn
Callback function for asynchronous writes.
unique_function< void(Expected< ReadUIntsResult< T > >)> OnReadUIntsCompleteFn
Proxy< void(ArrayRef< tpctypes::PointerWrite >)> MemWritePointersProxy
ProxyInit< FnT > proxyInit(Proxy< FnT > *P, typename Proxy< FnT >::DispatchFn Dispatch, StringRef Name, SymbolLookupFlags LookupFlags=SymbolLookupFlags::RequiredSymbol)
Proxy< std::vector< ExecutorAddr >(ArrayRef< ExecutorAddr >)> MemReadPointersProxy
Proxy< std::vector< uint8_t >(ArrayRef< ExecutorAddr >)> MemReadUInt8sProxy
Proxy< std::vector< uint32_t >(ArrayRef< ExecutorAddr >)> MemReadUInt32sProxy
Proxy< std::vector< uint64_t >(ArrayRef< ExecutorAddr >)> MemReadUInt64sProxy
Proxy< std::vector< std::vector< uint8_t > >(ArrayRef< ExecutorAddrRange >)> MemReadBuffersProxy
Proxy< std::vector< std::string >(ArrayRef< ExecutorAddr >)> MemReadStringsProxy
Error buildProxies(JITDylib &JD)
buildProxies base case.
Proxy< void(ArrayRef< tpctypes::UInt64Write >)> MemWriteUInt64sProxy
Proxy< void(ArrayRef< tpctypes::UInt8Write >)> MemWriteUInt8sProxy
Proxy< void(ArrayRef< tpctypes::UInt16Write >)> MemWriteUInt16sProxy
Proxy< std::vector< uint16_t >(ArrayRef< ExecutorAddr >)> MemReadUInt16sProxy
Proxy< void(ArrayRef< tpctypes::UInt32Write >)> MemWriteUInt32sProxy
Proxy< void(ArrayRef< tpctypes::BufferWrite >)> MemWriteBuffersProxy
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
Proxies for the executor-side memory-access functions.
rt::MemReadBuffersProxy ReadBuffers
rt::MemWriteUInt32sProxy WriteUInt32s
rt::MemReadStringsProxy ReadStrings
rt::MemReadUInt16sProxy ReadUInt16s
rt::MemReadPointersProxy ReadPointers
rt::MemReadUInt32sProxy ReadUInt32s
rt::MemReadUInt8sProxy ReadUInt8s
rt::MemReadUInt64sProxy ReadUInt64s
rt::MemWriteBuffersProxy WriteBuffers
rt::MemWriteUInt64sProxy WriteUInt64s
rt::MemWriteUInt8sProxy WriteUInt8s
rt::MemWriteUInt16sProxy WriteUInt16s
rt::MemWritePointersProxy WritePointers