| Lang Hames | fde9aaf | 2017-04-13 01:06:45 +0000 | [diff] [blame] | 1 | //===--------------- RPCUtils.cpp - RPCUtils implementation ---------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // RPCUtils implementation. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "llvm/ExecutionEngine/Orc/RPCUtils.h" |
| 15 | |
| 16 | char llvm::orc::rpc::RPCFatalError::ID = 0; |
| 17 | char llvm::orc::rpc::ConnectionClosed::ID = 0; |
| 18 | char llvm::orc::rpc::ResponseAbandoned::ID = 0; |
| 19 | char llvm::orc::rpc::CouldNotNegotiate::ID = 0; |
| 20 | |
| 21 | namespace llvm { |
| 22 | namespace orc { |
| 23 | namespace rpc { |
| 24 | |
| 25 | std::error_code ConnectionClosed::convertToErrorCode() const { |
| 26 | return orcError(OrcErrorCode::RPCConnectionClosed); |
| 27 | } |
| 28 | |
| 29 | void ConnectionClosed::log(raw_ostream &OS) const { |
| 30 | OS << "RPC connection already closed"; |
| 31 | } |
| 32 | |
| 33 | std::error_code ResponseAbandoned::convertToErrorCode() const { |
| 34 | return orcError(OrcErrorCode::RPCResponseAbandoned); |
| 35 | } |
| 36 | |
| 37 | void ResponseAbandoned::log(raw_ostream &OS) const { |
| 38 | OS << "RPC response abandoned"; |
| 39 | } |
| 40 | |
| 41 | CouldNotNegotiate::CouldNotNegotiate(std::string Signature) |
| 42 | : Signature(std::move(Signature)) {} |
| 43 | |
| 44 | std::error_code CouldNotNegotiate::convertToErrorCode() const { |
| 45 | return orcError(OrcErrorCode::RPCCouldNotNegotiateFunction); |
| 46 | } |
| 47 | |
| 48 | void CouldNotNegotiate::log(raw_ostream &OS) const { |
| 49 | OS << "Could not negotiate RPC function " << Signature; |
| 50 | } |
| 51 | |
| 52 | |
| 53 | } // end namespace rpc |
| 54 | } // end namespace orc |
| 55 | } // end namespace llvm |