1 //===--------------- RPCUtils.cpp - RPCUtils implementation ---------------===//
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
7 //===----------------------------------------------------------------------===//
9 // RPCUtils implementation.
11 //===----------------------------------------------------------------------===//
13 #include "llvm/ExecutionEngine/Orc/RPCUtils.h"
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;
24 std::error_code
ConnectionClosed::convertToErrorCode() const {
25 return orcError(OrcErrorCode::RPCConnectionClosed
);
28 void ConnectionClosed::log(raw_ostream
&OS
) const {
29 OS
<< "RPC connection already closed";
32 std::error_code
ResponseAbandoned::convertToErrorCode() const {
33 return orcError(OrcErrorCode::RPCResponseAbandoned
);
36 void ResponseAbandoned::log(raw_ostream
&OS
) const {
37 OS
<< "RPC response abandoned";
40 CouldNotNegotiate::CouldNotNegotiate(std::string Signature
)
41 : Signature(std::move(Signature
)) {}
43 std::error_code
CouldNotNegotiate::convertToErrorCode() const {
44 return orcError(OrcErrorCode::RPCCouldNotNegotiateFunction
);
47 void CouldNotNegotiate::log(raw_ostream
&OS
) const {
48 OS
<< "Could not negotiate RPC function " << Signature
;
52 } // end namespace rpc
53 } // end namespace orc
54 } // end namespace llvm