LLVM  8.0.1
Public Types | Public Member Functions | List of all members
llvm::orc::RemoteObjectClientLayer< RPCEndpoint > Class Template Reference

RemoteObjectClientLayer forwards the ORC Object Layer API over an RPC connection. More...

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

Inheritance diagram for llvm::orc::RemoteObjectClientLayer< RPCEndpoint >:
Inheritance graph
[legend]
Collaboration diagram for llvm::orc::RemoteObjectClientLayer< RPCEndpoint >:
Collaboration graph
[legend]

Public Types

using ObjHandleT = RemoteObjectLayerAPI::ObjHandleT
 
using RemoteSymbol = RemoteObjectLayerAPI::RemoteSymbol
 
using ObjectPtr = std::unique_ptr< MemoryBuffer >
 
- Public Types inherited from llvm::orc::RemoteObjectLayerAPI
using ObjHandleT = remote::ResourceIdMgr::ResourceId
 
using BadSymbolHandleError = remote::ResourceNotFound< RemoteSymbolId >
 
using BadObjectHandleError = remote::ResourceNotFound< ObjHandleT >
 

Public Member Functions

 RemoteObjectClientLayer (RPCEndpoint &Remote, std::function< void(Error)> ReportError)
 Create a RemoteObjectClientLayer that communicates with a RemoteObjectServerLayer instance via the given RPCEndpoint. More...
 
Expected< ObjHandleTaddObject (ObjectPtr ObjBuffer, std::shared_ptr< LegacyJITSymbolResolver > Resolver)
 Add an object to the JIT. More...
 
Error removeObject (ObjHandleT H)
 Remove the given object from the JIT. More...
 
JITSymbol findSymbol (StringRef Name, bool ExportedSymbolsOnly)
 Search for the given named symbol. More...
 
JITSymbol findSymbolIn (ObjHandleT H, StringRef Name, bool ExportedSymbolsOnly)
 Search for the given named symbol within the given context. More...
 
Error emitAndFinalize (ObjHandleT H)
 Immediately emit and finalize the object with the given handle. More...
 
- Public Member Functions inherited from llvm::orc::RemoteObjectLayer< RPCEndpoint >
 RemoteObjectLayer (RPCEndpoint &Remote, std::function< void(Error)> ReportError)
 

Additional Inherited Members

- Protected Types inherited from llvm::orc::RemoteObjectLayerAPI
using RemoteSymbolId = remote::ResourceIdMgr::ResourceId
 
using RemoteSymbol = std::pair< RemoteSymbolId, JITSymbolFlags >
 
- Protected Member Functions inherited from llvm::orc::RemoteObjectLayer< RPCEndpoint >
RemoteSymbol nullRemoteSymbol ()
 Convenience function for getting a null remote symbol value. More...
 
Error teeLog (Error Err)
 Creates a StringError that contains a copy of Err's log message, then sends that StringError to ReportError. More...
 
Error badRemoteSymbolIdError (RemoteSymbolId Id)
 
Error badObjectHandleError (ObjHandleT H)
 
Expected< RemoteSymboljitSymbolToRemote (JITSymbol Sym)
 Create a RemoteSymbol wrapping the given JITSymbol. More...
 
JITSymbol remoteToJITSymbol (Expected< RemoteSymbol > RemoteSymOrErr)
 Convert an Expected<RemoteSymbol> to a JITSymbol. More...
 
- Protected Attributes inherited from llvm::orc::RemoteObjectLayer< RPCEndpoint >
RPCEndpoint & Remote
 
std::function< void(Error)> ReportError
 
- Static Protected Attributes inherited from llvm::orc::RemoteObjectLayerAPI
static const ObjHandleT InvalidObjectHandleId = 0
 
static const RemoteSymbolId NullSymbolId = 0
 

Detailed Description

template<typename RPCEndpoint>
class llvm::orc::RemoteObjectClientLayer< RPCEndpoint >

RemoteObjectClientLayer forwards the ORC Object Layer API over an RPC connection.

This class can be used as the base layer of a JIT stack on the client and will forward operations to a corresponding RemoteObjectServerLayer on the server (which can be composed on top of a "real" object layer like RTDyldObjectLinkingLayer to actually carry out the operations).

Sending relocatable objects to the server (rather than fully relocated bits) allows JIT'd code to be cached on the server side and re-used in subsequent JIT sessions.

Definition at line 289 of file RemoteObjectLayer.h.

Member Typedef Documentation

◆ ObjectPtr

template<typename RPCEndpoint >
using llvm::orc::RemoteObjectClientLayer< RPCEndpoint >::ObjectPtr = std::unique_ptr<MemoryBuffer>

Definition at line 309 of file RemoteObjectLayer.h.

◆ ObjHandleT

template<typename RPCEndpoint >
using llvm::orc::RemoteObjectClientLayer< RPCEndpoint >::ObjHandleT = RemoteObjectLayerAPI::ObjHandleT

Definition at line 306 of file RemoteObjectLayer.h.

◆ RemoteSymbol

template<typename RPCEndpoint >
using llvm::orc::RemoteObjectClientLayer< RPCEndpoint >::RemoteSymbol = RemoteObjectLayerAPI::RemoteSymbol

Definition at line 307 of file RemoteObjectLayer.h.

Constructor & Destructor Documentation

◆ RemoteObjectClientLayer()

template<typename RPCEndpoint >
llvm::orc::RemoteObjectClientLayer< RPCEndpoint >::RemoteObjectClientLayer ( RPCEndpoint &  Remote,
std::function< void(Error)>  ReportError 
)
inline

Create a RemoteObjectClientLayer that communicates with a RemoteObjectServerLayer instance via the given RPCEndpoint.

The ReportError functor can be used locally log errors that are intended to be sent sent

Definition at line 316 of file RemoteObjectLayer.h.

References lookup().

Member Function Documentation

◆ addObject()

template<typename RPCEndpoint >
Expected<ObjHandleT> llvm::orc::RemoteObjectClientLayer< RPCEndpoint >::addObject ( ObjectPtr  ObjBuffer,
std::shared_ptr< LegacyJITSymbolResolver Resolver 
)
inline

Add an object to the JIT.

Returns
A handle that can be used to refer to the loaded object (for symbol searching, finalization, freeing memory, etc.).

Definition at line 330 of file RemoteObjectLayer.h.

References assert().

◆ emitAndFinalize()

template<typename RPCEndpoint >
Error llvm::orc::RemoteObjectClientLayer< RPCEndpoint >::emitAndFinalize ( ObjHandleT  H)
inline

Immediately emit and finalize the object with the given handle.

Definition at line 363 of file RemoteObjectLayer.h.

References H, lookup(), and Name.

◆ findSymbol()

template<typename RPCEndpoint >
JITSymbol llvm::orc::RemoteObjectClientLayer< RPCEndpoint >::findSymbol ( StringRef  Name,
bool  ExportedSymbolsOnly 
)
inline

Search for the given named symbol.

Definition at line 349 of file RemoteObjectLayer.h.

◆ findSymbolIn()

template<typename RPCEndpoint >
JITSymbol llvm::orc::RemoteObjectClientLayer< RPCEndpoint >::findSymbolIn ( ObjHandleT  H,
StringRef  Name,
bool  ExportedSymbolsOnly 
)
inline

Search for the given named symbol within the given context.

Definition at line 356 of file RemoteObjectLayer.h.

◆ removeObject()

template<typename RPCEndpoint >
Error llvm::orc::RemoteObjectClientLayer< RPCEndpoint >::removeObject ( ObjHandleT  H)
inline

Remove the given object from the JIT.

Definition at line 344 of file RemoteObjectLayer.h.

References H.


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