Lang Hames | fde9aaf | 2017-04-13 01:06:45 +0000 | [diff] [blame] | 1 | //===--------------- RPCUtils.cpp - RPCUtils implementation ---------------===// |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Lang Hames | fde9aaf | 2017-04-13 01:06:45 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // RPCUtils implementation. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | #include "llvm/ExecutionEngine/Orc/RPCUtils.h" |
| 14 | |
| 15 | char llvm::orc::rpc::RPCFatalError::ID = 0; |
| 16 | char llvm::orc::rpc::ConnectionClosed::ID = 0; |
| 17 | char llvm::orc::rpc::ResponseAbandoned::ID = 0; |
| 18 | char llvm::orc::rpc::CouldNotNegotiate::ID = 0; |
| 19 | |
| 20 | namespace llvm { |
| 21 | namespace orc { |
| 22 | namespace rpc { |
| 23 | |
| 24 | std::error_code ConnectionClosed::convertToErrorCode() const { |
| 25 | return orcError(OrcErrorCode::RPCConnectionClosed); |
| 26 | } |
| 27 | |
| 28 | void ConnectionClosed::log(raw_ostream &OS) const { |
| 29 | OS << "RPC connection already closed"; |
| 30 | } |
| 31 | |
| 32 | std::error_code ResponseAbandoned::convertToErrorCode() const { |
| 33 | return orcError(OrcErrorCode::RPCResponseAbandoned); |
| 34 | } |
| 35 | |
| 36 | void ResponseAbandoned::log(raw_ostream &OS) const { |
| 37 | OS << "RPC response abandoned"; |
| 38 | } |
| 39 | |
| 40 | CouldNotNegotiate::CouldNotNegotiate(std::string Signature) |
| 41 | : Signature(std::move(Signature)) {} |
| 42 | |
| 43 | std::error_code CouldNotNegotiate::convertToErrorCode() const { |
| 44 | return orcError(OrcErrorCode::RPCCouldNotNegotiateFunction); |
| 45 | } |
| 46 | |
| 47 | void CouldNotNegotiate::log(raw_ostream &OS) const { |
| 48 | OS << "Could not negotiate RPC function " << Signature; |
| 49 | } |
| 50 | |
| 51 | |
| 52 | } // end namespace rpc |
| 53 | } // end namespace orc |
| 54 | } // end namespace llvm |