|
LLVM 23.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 () override | |
| Expected< int32_t > | runAsMain (ExecutorAddr MainFnAddr, ArrayRef< std::string > Args) override |
| Run function with a main-like signature. | |
| Expected< int32_t > | runAsVoidFunction (ExecutorAddr VoidFnAddr) override |
| Run function with a int (*)(void) signature. | |
| Expected< int32_t > | runAsIntFunction (ExecutorAddr IntFnAddr, int Arg) override |
| Run function with a int (*)(int) signature. | |
| void | callWrapperAsync (ExecutorAddr WrapperFnAddr, IncomingWFRHandler OnComplete, ArrayRef< char > ArgBuffer) override |
| Run a wrapper function in the executor. | |
| Expected< std::unique_ptr< DylibManager > > | createDefaultDylibMgr () override |
| Create a default DylibManager for the target process. | |
| Error | disconnect () override |
| Disconnect from the target process. | |
| Expected< HandleMessageAction > | handleMessage (SimpleRemoteEPCOpcode OpC, uint64_t SeqNo, ExecutorAddr TagAddr, shared::WrapperFunctionBuffer ArgBytes) override |
| Handle receipt of a message. | |
| void | handleDisconnect (Error Err) override |
| Handle a disconnection from the underlying transport. | |
| Public Member Functions inherited from llvm::orc::ExecutorProcessControl | |
| ExecutorProcessControl (std::shared_ptr< SymbolStringPool > SSP, std::unique_ptr< TaskDispatcher > D) | |
| virtual | ~ExecutorProcessControl () |
| ExecutionSession & | getExecutionSession () |
| Return the ExecutionSession associated with this instance. | |
| SymbolStringPtr | intern (StringRef SymName) |
| Intern a symbol name in the SymbolStringPool. | |
| std::shared_ptr< SymbolStringPool > | getSymbolStringPool () const |
| Return a shared pointer to the SymbolStringPool for this instance. | |
| TaskDispatcher & | getDispatcher () |
| const Triple & | getTargetTriple () const |
| Return the Triple for the target process. | |
| unsigned | getPageSize () const |
| Get the page size for the target process. | |
| const JITDispatchInfo & | getJITDispatchInfo () const |
| Get the JIT dispatch function and context address for the executor. | |
| MemoryAccess & | getMemoryAccess () const |
| Return a MemoryAccess object for the target process. | |
| jitlink::JITLinkMemoryManager & | getMemMgr () const |
| Return a JITLinkMemoryManager for the target process. | |
| const StringMap< std::vector< char > > & | getBootstrapMap () const |
| Returns the bootstrap map. | |
| template<typename T, typename SPSTagT> | |
| Error | getBootstrapMapValue (StringRef Key, std::optional< T > &Val) const |
| Look up and SPS-deserialize a bootstrap map value. | |
| const StringMap< ExecutorAddr > & | getBootstrapSymbolsMap () const |
| Returns the bootstrap symbol map. | |
| 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. | |
| 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. | |
| template<typename FnT> | |
| void | callWrapperAsync (ExecutorAddr WrapperFnAddr, FnT &&OnComplete, ArrayRef< char > ArgBuffer) |
| Run a wrapper function in the executor. | |
| shared::WrapperFunctionBuffer | callWrapper (ExecutorAddr WrapperFnAddr, ArrayRef< char > ArgBuffer) |
| Run a wrapper function in the executor. | |
| 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. | |
| 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. | |
| 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. | |
| Public Member Functions inherited from llvm::orc::SimpleRemoteEPCTransportClient | |
| 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. | |
Additional Inherited Members | |
| Public Types inherited from llvm::orc::SimpleRemoteEPCTransportClient | |
| enum | HandleMessageAction { ContinueSession , EndSession } |
| Protected Attributes inherited from llvm::orc::ExecutorProcessControl | |
| 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< std::vector< char > > | BootstrapMap |
| StringMap< ExecutorAddr > | BootstrapSymbols |
Definition at line 31 of file SimpleRemoteEPC.h.
|
delete |
References SimpleRemoteEPC().
Referenced by Create(), operator=(), operator=(), SimpleRemoteEPC(), and SimpleRemoteEPC().
|
delete |
References SimpleRemoteEPC().
|
override |
Definition at line 20 of file SimpleRemoteEPC.cpp.
References assert().
|
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 53 of file SimpleRemoteEPC.cpp.
References assert(), llvm::orc::CallWrapper, llvm::orc::shared::WrapperFunctionBuffer::createOutOfBandError(), llvm::orc::ExecutorProcessControl::getExecutionSession(), H, I, and llvm::orc::ExecutionSession::reportError().
Referenced by operator=().
|
inlinestatic |
Create a SimpleRemoteEPC using the given transport type and args.
Definition at line 51 of file SimpleRemoteEPC.h.
References llvm::orc::ExecutorProcessControl::D, llvm::joinErrors(), and SimpleRemoteEPC().
|
overridevirtual |
Create a default DylibManager for the target process.
Implements llvm::orc::ExecutorProcessControl.
Definition at line 90 of file SimpleRemoteEPC.cpp.
References llvm::orc::EPCGenericDylibManager::CreateWithDefaultBootstrapSymbols(), and DM.
Referenced by operator=().
|
overridevirtual |
Disconnect from the target process.
This should be called after the JIT session is shut down.
Implements llvm::orc::ExecutorProcessControl.
Definition at line 97 of file SimpleRemoteEPC.cpp.
References llvm::orc::ExecutorProcessControl::D.
Referenced by operator=().
|
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 162 of file SimpleRemoteEPC.cpp.
References llvm::orc::shared::WrapperFunctionBuffer::createOutOfBandError(), llvm::dbgs(), llvm::joinErrors(), LLVM_DEBUG, and std::swap().
Referenced by operator=().
|
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 106 of file SimpleRemoteEPC.cpp.
References assert(), llvm::orc::CallWrapper, llvm::orc::SimpleRemoteEPCTransportClient::ContinueSession, llvm::dbgs(), llvm::orc::SimpleRemoteEPCTransportClient::EndSession, llvm::formatv(), llvm::orc::Hangup, llvm::inconvertibleErrorCode(), llvm::orc::LastOpC, LLVM_DEBUG, llvm::make_error(), llvm::orc::Result, llvm::orc::Setup, and llvm::orc::shared::WrapperFunctionBuffer::size().
Referenced by operator=().
|
delete |
References SimpleRemoteEPC().
|
delete |
References callWrapperAsync(), createDefaultDylibMgr(), llvm::orc::ExecutorProcessControl::D, disconnect(), llvm::orc::ExecutorProcessControl::ExecutorProcessControl(), handleDisconnect(), handleMessage(), llvm::move(), runAsIntFunction(), runAsMain(), runAsVoidFunction(), SimpleRemoteEPC(), and llvm::orc::ExecutorProcessControl::SSP.
|
overridevirtual |
Run function with a int (*)(int) signature.
Implements llvm::orc::ExecutorProcessControl.
Definition at line 44 of file SimpleRemoteEPC.cpp.
References llvm::orc::ExecutorProcessControl::callSPSWrapper(), and llvm::orc::Result.
Referenced by operator=().
|
overridevirtual |
Run function with a main-like signature.
Implements llvm::orc::ExecutorProcessControl.
Definition at line 27 of file SimpleRemoteEPC.cpp.
References llvm::orc::ExecutorProcessControl::callSPSWrapper(), and llvm::orc::Result.
Referenced by operator=().
|
overridevirtual |
Run function with a int (*)(void) signature.
Implements llvm::orc::ExecutorProcessControl.
Definition at line 36 of file SimpleRemoteEPC.cpp.
References llvm::orc::ExecutorProcessControl::callSPSWrapper(), and llvm::orc::Result.
Referenced by operator=().