diff options
| author | Lang Hames <lhames@gmail.com> | 2016-04-25 19:56:45 +0000 |
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2016-04-25 19:56:45 +0000 |
| commit | ef5a0ee2c3dad1c0e2fc51cf260a76d2acadf063 (patch) | |
| tree | b64ecf2ee46a302e33d6348b66917baf1bec1f2d /llvm/tools/lli/ChildTarget | |
| parent | 074ea2851c4a4c5afeba2390d905eca062d66096 (diff) | |
| download | bcm5719-llvm-ef5a0ee2c3dad1c0e2fc51cf260a76d2acadf063.tar.gz bcm5719-llvm-ef5a0ee2c3dad1c0e2fc51cf260a76d2acadf063.zip | |
[ORC] Thread Error/Expected through the RPC library.
This replaces use of std::error_code and ErrorOr in the ORC RPC support library
with Error and Expected. This required updating the OrcRemoteTarget API, Client,
and server code, as well as updating the Orc C API.
This patch also fixes several instances where Errors were dropped.
llvm-svn: 267457
Diffstat (limited to 'llvm/tools/lli/ChildTarget')
| -rw-r--r-- | llvm/tools/lli/ChildTarget/ChildTarget.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/tools/lli/ChildTarget/ChildTarget.cpp b/llvm/tools/lli/ChildTarget/ChildTarget.cpp index b7dcaaa3ea9..1a6cd4211d0 100644 --- a/llvm/tools/lli/ChildTarget/ChildTarget.cpp +++ b/llvm/tools/lli/ChildTarget/ChildTarget.cpp @@ -17,6 +17,8 @@ typedef OrcX86_64 HostOrcArch; typedef OrcGenericArchitecture HostOrcArch; #endif +ExitOnError ExitOnErr; + int main(int argc, char *argv[]) { if (argc != 3) { @@ -24,6 +26,8 @@ int main(int argc, char *argv[]) { return 1; } + ExitOnErr.setBanner(std::string(argv[0]) + ":"); + int InFD; int OutFD; { @@ -55,20 +59,15 @@ int main(int argc, char *argv[]) { while (1) { uint32_t RawId; - if (auto EC = Server.startReceivingFunction(Channel, RawId)) { - errs() << "Error: " << EC.message() << "\n"; - return 1; - } + ExitOnErr(Server.startReceivingFunction(Channel, RawId)); auto Id = static_cast<JITServer::JITFuncId>(RawId); switch (Id) { case JITServer::TerminateSessionId: - Server.handleTerminateSession(); + ExitOnErr(Server.handleTerminateSession()); return 0; default: - if (auto EC = Server.handleKnownFunction(Id)) { - errs() << "Error: " << EC.message() << "\n"; - return 1; - } + ExitOnErr(Server.handleKnownFunction(Id)); + break; } } |

