LLVM 20.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::orc::SimpleRemoteEPCServer Class Reference

A simple EPC server implementation. More...

#include "llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h"

Inheritance diagram for llvm::orc::SimpleRemoteEPCServer:
Inheritance graph
[legend]

Classes

class  Dispatcher
 Dispatches calls to runWrapper. More...
 
class  Setup
 

Public Types

using ReportErrorFunction = unique_function< void(Error)>
 
- Public Types inherited from llvm::orc::SimpleRemoteEPCTransportClient
enum  HandleMessageAction { ContinueSession , EndSession }
 

Public Member Functions

void setErrorReporter (ReportErrorFunction ReportError)
 Set an error reporter for this server.
 
Expected< HandleMessageActionhandleMessage (SimpleRemoteEPCOpcode OpC, uint64_t SeqNo, ExecutorAddr TagAddr, SimpleRemoteEPCArgBytesVector ArgBytes) override
 Call to handle an incoming message.
 
Error waitForDisconnect ()
 
void handleDisconnect (Error Err) override
 Handle a disconnection from the underlying transport.
 
- Public Member Functions inherited from llvm::orc::SimpleRemoteEPCTransportClient
virtual ~SimpleRemoteEPCTransportClient ()
 
virtual Expected< HandleMessageActionhandleMessage (SimpleRemoteEPCOpcode OpC, uint64_t SeqNo, ExecutorAddr TagAddr, SimpleRemoteEPCArgBytesVector ArgBytes)=0
 Handle receipt of a message.
 
virtual void handleDisconnect (Error Err)=0
 Handle a disconnection from the underlying transport.
 

Static Public Member Functions

static StringMap< ExecutorAddrdefaultBootstrapSymbols ()
 
template<typename TransportT , typename... TransportTCtorArgTs>
static Expected< std::unique_ptr< SimpleRemoteEPCServer > > Create (unique_function< Error(Setup &S)> SetupFunction, TransportTCtorArgTs &&...TransportTCtorArgs)
 

Detailed Description

A simple EPC server implementation.

Definition at line 36 of file SimpleRemoteEPCServer.h.

Member Typedef Documentation

◆ ReportErrorFunction

Definition at line 38 of file SimpleRemoteEPCServer.h.

Member Function Documentation

◆ Create()

template<typename TransportT , typename... TransportTCtorArgTs>
static Expected< std::unique_ptr< SimpleRemoteEPCServer > > llvm::orc::SimpleRemoteEPCServer::Create ( unique_function< Error(Setup &S)>  SetupFunction,
TransportTCtorArgTs &&...  TransportTCtorArgs 
)
inlinestatic

◆ defaultBootstrapSymbols()

StringMap< ExecutorAddr > llvm::orc::SimpleRemoteEPCServer::defaultBootstrapSymbols ( )
static

Definition at line 56 of file SimpleRemoteEPCServer.cpp.

References llvm::orc::rt_bootstrap::addTo().

◆ handleDisconnect()

void llvm::orc::SimpleRemoteEPCServer::handleDisconnect ( Error  Err)
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 122 of file SimpleRemoteEPCServer.cpp.

References llvm::orc::shared::WrapperFunctionResult::createOutOfBandError(), llvm::joinErrors(), and std::swap().

◆ handleMessage()

Expected< SimpleRemoteEPCTransportClient::HandleMessageAction > llvm::orc::SimpleRemoteEPCServer::handleMessage ( SimpleRemoteEPCOpcode  OpC,
uint64_t  SeqNo,
ExecutorAddr  TagAddr,
SimpleRemoteEPCArgBytesVector  ArgBytes 
)
overridevirtual

Call to handle an incoming message.

Returns 'Disconnect' if the message is a 'detach' message from the remote otherwise returns 'Continue'. If the server has moved to an error state, returns an error, which should be reported and treated as a 'Disconnect'.

Implements llvm::orc::SimpleRemoteEPCTransportClient.

Definition at line 63 of file SimpleRemoteEPCServer.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::orc::Result, llvm::orc::Setup, and llvm::SmallVectorBase< Size_T >::size().

◆ setErrorReporter()

void llvm::orc::SimpleRemoteEPCServer::setErrorReporter ( ReportErrorFunction  ReportError)
inline

Set an error reporter for this server.

Definition at line 136 of file SimpleRemoteEPCServer.h.

◆ waitForDisconnect()

Error llvm::orc::SimpleRemoteEPCServer::waitForDisconnect ( )

Definition at line 116 of file SimpleRemoteEPCServer.cpp.


The documentation for this class was generated from the following files: