LLVM  8.0.1
Classes | Public Member Functions | Static Public Member Functions | List of all members
llvm::orc::remote::OrcRemoteTargetClient Class Reference

This class provides utilities (including memory manager, indirect stubs manager, and compile callback manager types) that support remote JITing in ORC. More...

#include "llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h"

Inheritance diagram for llvm::orc::remote::OrcRemoteTargetClient:
Inheritance graph
[legend]
Collaboration diagram for llvm::orc::remote::OrcRemoteTargetClient:
Collaboration graph
[legend]

Classes

class  RemoteCompileCallbackManager
 Remote compile callback manager. More...
 
class  RemoteIndirectStubsManager
 Remote indirect stubs manager. More...
 
class  RemoteRTDyldMemoryManager
 Remote-mapped RuntimeDyld-compatible memory manager. More...
 
class  RemoteTrampolinePool
 

Public Member Functions

Expected< int > callIntVoid (JITTargetAddress Addr)
 Call the int(void) function at the given address in the target and return its result. More...
 
Expected< int > callMain (JITTargetAddress Addr, const std::vector< std::string > &Args)
 Call the int(int, char*[]) function at the given address in the target and return its result. More...
 
Error callVoidVoid (JITTargetAddress Addr)
 Call the void() function at the given address in the target and wait for it to finish. More...
 
Expected< std::unique_ptr< RemoteRTDyldMemoryManager > > createRemoteMemoryManager ()
 Create an RCMemoryManager which will allocate its memory on the remote target. More...
 
Expected< std::unique_ptr< RemoteIndirectStubsManager > > createIndirectStubsManager ()
 Create an RCIndirectStubsManager that will allocate stubs on the remote target. More...
 
Expected< RemoteCompileCallbackManager & > enableCompileCallbacks (JITTargetAddress ErrorHandlerAddress)
 
Expected< JITTargetAddressgetSymbolAddress (StringRef Name)
 Search for symbols in the remote process. More...
 
const std::string & getTargetTriple () const
 Get the triple for the remote target. More...
 
Error terminateSession ()
 
- Public Member Functions inherited from llvm::orc::rpc::SingleThreadedRPCEndpoint< rpc::RawByteChannel >
 SingleThreadedRPCEndpoint (rpc::RawByteChannel &C, bool LazyAutoNegotiation)
 
void addHandler (HandlerT Handler)
 
void addHandler (ClassT &Object, RetT(ClassT::*Method)(ArgTs...))
 
void addAsyncHandler (HandlerT Handler)
 
void addAsyncHandler (ClassT &Object, RetT(ClassT::*Method)(ArgTs...))
 Add a class-method as a handler. More...
 
detail::ResultTraits< AltRetT >::ErrorReturnType callB (const ArgTs &... Args)
 
- Public Member Functions inherited from llvm::orc::rpc::detail::RPCEndpointBase< SingleThreadedRPCEndpoint< rpc::RawByteChannel, uint32_t, uint32_t >, rpc::RawByteChannel, uint32_t, uint32_t >
 RPCEndpointBase (rpc::RawByteChannel &C, bool LazyAutoNegotiation)
 Construct an RPC instance on a channel. More...
 
Error negotiateFunction (bool Retry=false)
 Negotiate a function id for Func with the other end of the channel. More...
 
Error appendCallAsync (HandlerT Handler, const ArgTs &... Args)
 Append a call Func, does not call send on the channel. More...
 
Error sendAppendedCalls ()
 
Error callAsync (HandlerT Handler, const ArgTs &... Args)
 
Error handleOne ()
 Handle one incoming call. More...
 
void abandonPendingResponses ()
 Abandon all outstanding result handlers. More...
 
void removeHandler ()
 Remove the handler for the given function. More...
 
void clearHandlers ()
 Clear all handlers. More...
 

Static Public Member Functions

static Expected< std::unique_ptr< OrcRemoteTargetClient > > Create (rpc::RawByteChannel &Channel, ExecutionSession &ES)
 Create an OrcRemoteTargetClient. More...
 
- Static Public Member Functions inherited from llvm::orc::rpc::detail::RPCEndpointBase< SingleThreadedRPCEndpoint< rpc::RawByteChannel, uint32_t, uint32_t >, rpc::RawByteChannel, uint32_t, uint32_t >
**static detail::ReadArgs< ArgTs... > readArgs (ArgTs &... Args)
 Helper for handling setter procedures - this method returns a functor that sets the variables referred to by Args... More...
 

Additional Inherited Members

- Protected Types inherited from llvm::orc::rpc::detail::RPCEndpointBase< SingleThreadedRPCEndpoint< rpc::RawByteChannel, uint32_t, uint32_t >, rpc::RawByteChannel, uint32_t, uint32_t >
using WrappedHandlerFn = std::function< Error(rpc::RawByteChannel &, uint32_t)>
 
- Protected Member Functions inherited from llvm::orc::rpc::detail::RPCEndpointBase< SingleThreadedRPCEndpoint< rpc::RawByteChannel, uint32_t, uint32_t >, rpc::RawByteChannel, uint32_t, uint32_t >
uint32_t getInvalidFunctionId () const
 
void addHandlerImpl (HandlerT Handler)
 Add the given handler to the handler map and make it available for autonegotiation and execution. More...
 
void addAsyncHandlerImpl (HandlerT Handler)
 
Error handleResponse (uint32_t SeqNo)
 
uint32_t handleNegotiate (const std::string &Name)
 
Expected< uint32_tgetRemoteFunctionId (bool NegotiateIfNotInMap, bool NegotiateIfInvalid)
 
WrappedHandlerFn wrapHandler (HandlerT Handler)
 
WrappedHandlerFn wrapAsyncHandler (HandlerT Handler)
 
- Protected Attributes inherited from llvm::orc::rpc::detail::RPCEndpointBase< SingleThreadedRPCEndpoint< rpc::RawByteChannel, uint32_t, uint32_t >, rpc::RawByteChannel, uint32_t, uint32_t >
rpc::RawByteChannelC
 
bool LazyAutoNegotiation
 
RPCFunctionIdAllocator< uint32_tFnIdAllocator
 
uint32_t ResponseId
 
std::map< std::string, uint32_tLocalFunctionIds
 
std::map< const char *, uint32_tRemoteFunctionIds
 
std::map< uint32_t, WrappedHandlerFnHandlers
 
std::mutex ResponsesMutex
 
detail::SequenceNumberManager< uint32_tSequenceNumberMgr
 
std::map< uint32_t, std::unique_ptr< detail::ResponseHandler< rpc::RawByteChannel > > > PendingResponses
 

Detailed Description

This class provides utilities (including memory manager, indirect stubs manager, and compile callback manager types) that support remote JITing in ORC.

Each of the utility classes talks to a JIT server (an instance of the OrcRemoteTargetServer class) via an RPC system (see RPCUtils.h) to carry out its actions.

Definition at line 56 of file OrcRemoteTargetClient.h.

Member Function Documentation

◆ callIntVoid()

Expected<int> llvm::orc::remote::OrcRemoteTargetClient::callIntVoid ( JITTargetAddress  Addr)
inline

Call the int(void) function at the given address in the target and return its result.

Definition at line 516 of file OrcRemoteTargetClient.h.

References llvm::dbgs(), llvm::format(), and LLVM_DEBUG.

◆ callMain()

Expected<int> llvm::orc::remote::OrcRemoteTargetClient::callMain ( JITTargetAddress  Addr,
const std::vector< std::string > &  Args 
)
inline

Call the int(int, char*[]) function at the given address in the target and return its result.

Definition at line 524 of file OrcRemoteTargetClient.h.

References llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::dbgs(), llvm::format(), and LLVM_DEBUG.

◆ callVoidVoid()

Error llvm::orc::remote::OrcRemoteTargetClient::callVoidVoid ( JITTargetAddress  Addr)
inline

Call the void() function at the given address in the target and wait for it to finish.

Definition at line 533 of file OrcRemoteTargetClient.h.

References llvm::dbgs(), llvm::format(), and LLVM_DEBUG.

◆ Create()

static Expected<std::unique_ptr<OrcRemoteTargetClient> > llvm::orc::remote::OrcRemoteTargetClient::Create ( rpc::RawByteChannel Channel,
ExecutionSession ES 
)
inlinestatic

Create an OrcRemoteTargetClient.

Channel is the ChannelT instance to communicate on. It is assumed that the channel is ready to be read from and written to.

Definition at line 505 of file OrcRemoteTargetClient.h.

◆ createIndirectStubsManager()

Expected<std::unique_ptr<RemoteIndirectStubsManager> > llvm::orc::remote::OrcRemoteTargetClient::createIndirectStubsManager ( )
inline

Create an RCIndirectStubsManager that will allocate stubs on the remote target.

Definition at line 553 of file OrcRemoteTargetClient.h.

◆ createRemoteMemoryManager()

Expected<std::unique_ptr<RemoteRTDyldMemoryManager> > llvm::orc::remote::OrcRemoteTargetClient::createRemoteMemoryManager ( )
inline

Create an RCMemoryManager which will allocate its memory on the remote target.

Definition at line 542 of file OrcRemoteTargetClient.h.

◆ enableCompileCallbacks()

Expected<RemoteCompileCallbackManager &> llvm::orc::remote::OrcRemoteTargetClient::enableCompileCallbacks ( JITTargetAddress  ErrorHandlerAddress)
inline

Definition at line 561 of file OrcRemoteTargetClient.h.

References assert().

◆ getSymbolAddress()

Expected<JITTargetAddress> llvm::orc::remote::OrcRemoteTargetClient::getSymbolAddress ( StringRef  Name)
inline

Search for symbols in the remote process.

Note: This should be used by symbol resolvers after they've searched the local symbol table in the JIT stack.

Definition at line 577 of file OrcRemoteTargetClient.h.

References Name.

◆ getTargetTriple()

const std::string& llvm::orc::remote::OrcRemoteTargetClient::getTargetTriple ( ) const
inline

Get the triple for the remote target.

Definition at line 582 of file OrcRemoteTargetClient.h.

◆ terminateSession()

Error llvm::orc::remote::OrcRemoteTargetClient::terminateSession ( )
inline

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