LLVM 22.0.0git
llvm::orc::SimpleRemoteEPCServer Class Reference

A simple EPC server implementation. More...

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

Inheritance diagram for llvm::orc::SimpleRemoteEPCServer:
[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 ()

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 37 of file SimpleRemoteEPCServer.h.

Member Typedef Documentation

◆ ReportErrorFunction

Member Function Documentation

◆ Create()

template<typename TransportT, typename... TransportTCtorArgTs>
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 55 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 121 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 62 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::make_error(), llvm::orc::Result, llvm::orc::Setup, and llvm::SmallVectorTemplateCommon< T, typename >::size().

◆ setErrorReporter()

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

Set an error reporter for this server.

Definition at line 137 of file SimpleRemoteEPCServer.h.

◆ waitForDisconnect()

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

Definition at line 115 of file SimpleRemoteEPCServer.cpp.


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