diff options
| author | Lang Hames <lhames@gmail.com> | 2017-09-04 20:54:46 +0000 |
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2017-09-04 20:54:46 +0000 |
| commit | 9e68b734d6d0a98c672aebbe64956476cc140008 (patch) | |
| tree | 01d390bb328b5d38d058d71d15f96f19ea871285 /llvm/tools | |
| parent | 783d433f169c5c5a0136c26d951796657f67d971 (diff) | |
| download | bcm5719-llvm-9e68b734d6d0a98c672aebbe64956476cc140008.tar.gz bcm5719-llvm-9e68b734d6d0a98c672aebbe64956476cc140008.zip | |
[ORC] Refactor OrcRemoteTarget code to expose its RPC API, reduce
code duplication in the client, and improve error propagation.
This patch moves the OrcRemoteTarget rpc::Function declarations from
OrcRemoteTargetRPCAPI into their own namespaces under llvm::orc::remote so that
they can be used in new contexts (in particular, a remote-object-file adapter
layer that I will commit shortly).
Code duplication in OrcRemoteTargetClient (especially in loops processing the
code, rw-data and ro-data allocations) is removed by moving the loop bodies
into their own functions.
Error propagation is (slightly) improved by adding an ErrorReporter functor to
the OrcRemoteTargetClient -- Errors that can't be returned (because they occur
in destructors, or behind stable APIs that don't provide error returns) can be
sent to the ErrorReporter instead. Some methods in the Client API are also
changed to make better use of the Expected class: returning Expected<T>s rather
than returning Errors and taking T&s to store the results.
llvm-svn: 312500
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/lli/lli.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index 5167628b1a9..cd43e9d5791 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -607,13 +607,11 @@ int main(int argc, char **argv, char * const *envp) { } // Create a remote target client running over the channel. - typedef orc::remote::OrcRemoteTargetClient<orc::rpc::RawByteChannel> - MyRemote; - auto R = ExitOnErr(MyRemote::Create(*C)); + typedef orc::remote::OrcRemoteTargetClient MyRemote; + auto R = ExitOnErr(MyRemote::Create(*C, ExitOnErr)); // Create a remote memory manager. - std::unique_ptr<MyRemote::RCMemoryManager> RemoteMM; - ExitOnErr(R->createRemoteMemoryManager(RemoteMM)); + auto RemoteMM = ExitOnErr(R->createRemoteMemoryManager()); // Forward MCJIT's memory manager calls to the remote memory manager. static_cast<ForwardingMemoryManager*>(RTDyldMM)->setMemMgr( |

