LLVM
15.0.0git
|
#include "llvm/ExecutionEngine/Orc/SimpleRemoteEPC.h"
Classes | |
struct | Setup |
A setup object containing callbacks to construct a memory manager and memory access object. More... | |
Public Member Functions | |
SimpleRemoteEPC (const SimpleRemoteEPC &)=delete | |
SimpleRemoteEPC & | operator= (const SimpleRemoteEPC &)=delete |
SimpleRemoteEPC (SimpleRemoteEPC &&)=delete | |
SimpleRemoteEPC & | operator= (SimpleRemoteEPC &&)=delete |
~SimpleRemoteEPC () | |
Expected< tpctypes::DylibHandle > | loadDylib (const char *DylibPath) override |
Load the dynamic library at the given path and return a handle to it. More... | |
Expected< std::vector< tpctypes::LookupResult > > | lookupSymbols (ArrayRef< LookupRequest > Request) override |
Search for symbols in the target process. More... | |
Expected< int32_t > | runAsMain (ExecutorAddr MainFnAddr, ArrayRef< std::string > Args) override |
Run function with a main-like signature. More... | |
void | callWrapperAsync (ExecutorAddr WrapperFnAddr, IncomingWFRHandler OnComplete, ArrayRef< char > ArgBuffer) override |
Run a wrapper function in the executor. More... | |
Error | disconnect () override |
Disconnect from the target process. More... | |
Expected< HandleMessageAction > | handleMessage (SimpleRemoteEPCOpcode OpC, uint64_t SeqNo, ExecutorAddr TagAddr, SimpleRemoteEPCArgBytesVector ArgBytes) override |
Handle receipt of a message. More... | |
void | handleDisconnect (Error Err) override |
Handle a disconnection from the underlying transport. More... | |
![]() | |
ExecutorProcessControl (std::shared_ptr< SymbolStringPool > SSP, std::unique_ptr< TaskDispatcher > D) | |
virtual | ~ExecutorProcessControl () |
ExecutionSession & | getExecutionSession () |
Return the ExecutionSession associated with this instance. More... | |
SymbolStringPtr | intern (StringRef SymName) |
Intern a symbol name in the SymbolStringPool. More... | |
std::shared_ptr< SymbolStringPool > | getSymbolStringPool () const |
Return a shared pointer to the SymbolStringPool for this instance. More... | |
TaskDispatcher & | getDispatcher () |
const Triple & | getTargetTriple () const |
Return the Triple for the target process. More... | |
unsigned | getPageSize () const |
Get the page size for the target process. More... | |
const JITDispatchInfo & | getJITDispatchInfo () const |
Get the JIT dispatch function and context address for the executor. More... | |
MemoryAccess & | getMemoryAccess () const |
Return a MemoryAccess object for the target process. More... | |
jitlink::JITLinkMemoryManager & | getMemMgr () const |
Return a JITLinkMemoryManager for the target process. More... | |
const StringMap< ExecutorAddr > & | getBootstrapSymbolsMap () const |
Returns the bootstrap symbol map. More... | |
Error | getBootstrapSymbols (ArrayRef< std::pair< ExecutorAddr &, StringRef >> Pairs) const |
For each (ExecutorAddr&, StringRef) pair, looks up the string in the bootstrap symbols map and writes its address to the ExecutorAddr if found. More... | |
template<typename RunPolicyT , typename FnT > | |
void | callWrapperAsync (RunPolicyT &&Runner, ExecutorAddr WrapperFnAddr, FnT &&OnComplete, ArrayRef< char > ArgBuffer) |
Run a wrapper function in the executor using the given Runner to dispatch OnComplete when the result is ready. More... | |
template<typename FnT > | |
void | callWrapperAsync (ExecutorAddr WrapperFnAddr, FnT &&OnComplete, ArrayRef< char > ArgBuffer) |
Run a wrapper function in the executor. More... | |
shared::WrapperFunctionResult | callWrapper (ExecutorAddr WrapperFnAddr, ArrayRef< char > ArgBuffer) |
Run a wrapper function in the executor. More... | |
template<typename SPSSignature , typename RunPolicyT , typename SendResultT , typename... ArgTs> | |
void | callSPSWrapperAsync (RunPolicyT &&Runner, ExecutorAddr WrapperFnAddr, SendResultT &&SendResult, const ArgTs &...Args) |
Run a wrapper function using SPS to serialize the arguments and deserialize the results. More... | |
template<typename SPSSignature , typename SendResultT , typename... ArgTs> | |
void | callSPSWrapperAsync (ExecutorAddr WrapperFnAddr, SendResultT &&SendResult, const ArgTs &...Args) |
Run a wrapper function using SPS to serialize the arguments and deserialize the results. More... | |
template<typename SPSSignature , typename... WrapperCallArgTs> | |
Error | callSPSWrapper (ExecutorAddr WrapperFnAddr, WrapperCallArgTs &&...WrapperCallArgs) |
Run a wrapper function using SPS to serialize the arguments and deserialize the results. More... | |
![]() | |
virtual | ~SimpleRemoteEPCTransportClient () |
Static Public Member Functions | |
template<typename TransportT , typename... TransportTCtorArgTs> | |
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. More... | |
Additional Inherited Members | |
![]() | |
enum | HandleMessageAction { ContinueSession, EndSession } |
![]() | |
std::shared_ptr< SymbolStringPool > | SSP |
std::unique_ptr< TaskDispatcher > | D |
ExecutionSession * | ES = nullptr |
Triple | TargetTriple |
unsigned | PageSize = 0 |
JITDispatchInfo | JDI |
MemoryAccess * | MemAccess = nullptr |
jitlink::JITLinkMemoryManager * | MemMgr = nullptr |
StringMap< ExecutorAddr > | BootstrapSymbols |
Definition at line 31 of file SimpleRemoteEPC.h.
|
delete |
Referenced by Create().
|
delete |
llvm::orc::SimpleRemoteEPC::~SimpleRemoteEPC | ( | ) |
Definition at line 20 of file SimpleRemoteEPC.cpp.
References assert(), and llvm::Lock.
|
overridevirtual |
Run a wrapper function in the executor.
The given WFRHandler will be called on the result when it is returned.
The wrapper function should be callable as:
{.cpp}
Implements llvm::orc::ExecutorProcessControl.
Definition at line 57 of file SimpleRemoteEPC.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::Lock, and move.
|
inlinestatic |
Create a SimpleRemoteEPC using the given transport type and args.
Definition at line 51 of file SimpleRemoteEPC.h.
References llvm::orc::ExecutorProcessControl::D, move, and SimpleRemoteEPC().
|
overridevirtual |
Disconnect from the target process.
This should be called after the JIT session is shut down.
Implements llvm::orc::ExecutorProcessControl.
Definition at line 93 of file SimpleRemoteEPC.cpp.
References llvm::orc::ExecutorProcessControl::D, llvm::Lock, and move.
|
overridevirtual |
Handle a disconnection from the underlying transport.
No further messages should be sent to handleMessage after this is called. Err may contain an Error value indicating unexpected disconnection. This allows clients to log such errors, but no attempt should be made at recovery (which should be handled inside the transport class, if it is supported at all).
Implements llvm::orc::SimpleRemoteEPCTransportClient.
Definition at line 159 of file SimpleRemoteEPC.cpp.
|
overridevirtual |
Handle receipt of a message.
Returns an Error if the message cannot be handled, 'EndSession' if the client will not accept any further messages, and 'ContinueSession' otherwise.
Implements llvm::orc::SimpleRemoteEPCTransportClient.
Definition at line 102 of file SimpleRemoteEPC.cpp.
References assert(), llvm::orc::CallWrapper, llvm::dbgs(), llvm::formatv(), llvm::orc::ExecutorAddr::getValue(), llvm::orc::Hangup, llvm::inconvertibleErrorCode(), llvm::orc::LastOpC, LLVM_DEBUG, llvm::orc::Result, and llvm::orc::Setup.
|
overridevirtual |
Load the dynamic library at the given path and return a handle to it.
If LibraryPath is null this function will return the global handle for the target process.
Implements llvm::orc::ExecutorProcessControl.
Definition at line 28 of file SimpleRemoteEPC.cpp.
|
overridevirtual |
Search for symbols in the target process.
The result of the lookup is a 2-dimentional array of target addresses that correspond to the lookup order. If a required symbol is not found then this method will return an error. If a weakly referenced symbol is not found then it be assigned a '0' value.
Implements llvm::orc::ExecutorProcessControl.
Definition at line 33 of file SimpleRemoteEPC.cpp.
|
delete |
|
delete |
|
overridevirtual |
Run function with a main-like signature.
Implements llvm::orc::ExecutorProcessControl.
Definition at line 48 of file SimpleRemoteEPC.cpp.