blob: 367b3639f84119f7aa7ee59b0ee6f19bad7e4ebc [file] [log] [blame]
Lang Hamesfde9aaf2017-04-13 01:06:45 +00001//===--------------- RPCUtils.cpp - RPCUtils implementation ---------------===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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 Hamesfde9aaf2017-04-13 01:06:45 +00006//
7//===----------------------------------------------------------------------===//
8//
9// RPCUtils implementation.
10//
11//===----------------------------------------------------------------------===//
12
13#include "llvm/ExecutionEngine/Orc/RPCUtils.h"
14
15char llvm::orc::rpc::RPCFatalError::ID = 0;
16char llvm::orc::rpc::ConnectionClosed::ID = 0;
17char llvm::orc::rpc::ResponseAbandoned::ID = 0;
18char llvm::orc::rpc::CouldNotNegotiate::ID = 0;
19
20namespace llvm {
21namespace orc {
22namespace rpc {
23
24std::error_code ConnectionClosed::convertToErrorCode() const {
25 return orcError(OrcErrorCode::RPCConnectionClosed);
26}
27
28void ConnectionClosed::log(raw_ostream &OS) const {
29 OS << "RPC connection already closed";
30}
31
32std::error_code ResponseAbandoned::convertToErrorCode() const {
33 return orcError(OrcErrorCode::RPCResponseAbandoned);
34}
35
36void ResponseAbandoned::log(raw_ostream &OS) const {
37 OS << "RPC response abandoned";
38}
39
40CouldNotNegotiate::CouldNotNegotiate(std::string Signature)
41 : Signature(std::move(Signature)) {}
42
43std::error_code CouldNotNegotiate::convertToErrorCode() const {
44 return orcError(OrcErrorCode::RPCCouldNotNegotiateFunction);
45}
46
47void 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