]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/llvm/lib/ExecutionEngine/OrcError/RPCError.cpp
Unbreak DRM KMS build by adding the needed compatibility field in the LinuxKPI.
[FreeBSD/FreeBSD.git] / contrib / llvm-project / llvm / lib / ExecutionEngine / OrcError / RPCError.cpp
1 //===--------------- RPCError.cpp - RPCERror implementation ---------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // RPC Error type implmentations.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "llvm/ExecutionEngine/Orc/RPC/RPCUtils.h"
14 #include "llvm/Support/Error.h"
15 #include "llvm/Support/raw_ostream.h"
16
17 #include <system_error>
18 #include <string>
19
20 char llvm::orc::rpc::RPCFatalError::ID = 0;
21 char llvm::orc::rpc::ConnectionClosed::ID = 0;
22 char llvm::orc::rpc::ResponseAbandoned::ID = 0;
23 char llvm::orc::rpc::CouldNotNegotiate::ID = 0;
24
25 namespace llvm {
26 namespace orc {
27 namespace rpc {
28
29 std::error_code ConnectionClosed::convertToErrorCode() const {
30   return orcError(OrcErrorCode::RPCConnectionClosed);
31 }
32
33 void ConnectionClosed::log(raw_ostream &OS) const {
34   OS << "RPC connection already closed";
35 }
36
37 std::error_code ResponseAbandoned::convertToErrorCode() const {
38   return orcError(OrcErrorCode::RPCResponseAbandoned);
39 }
40
41 void ResponseAbandoned::log(raw_ostream &OS) const {
42   OS << "RPC response abandoned";
43 }
44
45 CouldNotNegotiate::CouldNotNegotiate(std::string Signature)
46     : Signature(std::move(Signature)) {}
47
48 std::error_code CouldNotNegotiate::convertToErrorCode() const {
49   return orcError(OrcErrorCode::RPCCouldNotNegotiateFunction);
50 }
51
52 void CouldNotNegotiate::log(raw_ostream &OS) const {
53   OS << "Could not negotiate RPC function " << Signature;
54 }
55
56
57 } // end namespace rpc
58 } // end namespace orc
59 } // end namespace llvm