blob: 2a7ab5ca81807df318704b5f482c25f6522e89e2 [file] [log] [blame]
Lang Hamesfde9aaf2017-04-13 01:06:45 +00001//===--------------- 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
16char llvm::orc::rpc::RPCFatalError::ID = 0;
17char llvm::orc::rpc::ConnectionClosed::ID = 0;
18char llvm::orc::rpc::ResponseAbandoned::ID = 0;
19char llvm::orc::rpc::CouldNotNegotiate::ID = 0;
20
21namespace llvm {
22namespace orc {
23namespace rpc {
24
25std::error_code ConnectionClosed::convertToErrorCode() const {
26 return orcError(OrcErrorCode::RPCConnectionClosed);
27}
28
29void ConnectionClosed::log(raw_ostream &OS) const {
30 OS << "RPC connection already closed";
31}
32
33std::error_code ResponseAbandoned::convertToErrorCode() const {
34 return orcError(OrcErrorCode::RPCResponseAbandoned);
35}
36
37void ResponseAbandoned::log(raw_ostream &OS) const {
38 OS << "RPC response abandoned";
39}
40
41CouldNotNegotiate::CouldNotNegotiate(std::string Signature)
42 : Signature(std::move(Signature)) {}
43
44std::error_code CouldNotNegotiate::convertToErrorCode() const {
45 return orcError(OrcErrorCode::RPCCouldNotNegotiateFunction);
46}
47
48void 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