26class OrcErrorCategory :
public std::error_category {
28 const char *
name()
const noexcept
override {
return "orc"; }
30 std::string message(
int condition)
const override {
32 case OrcErrorCode::UnknownORCError:
33 return "Unknown ORC error";
34 case OrcErrorCode::DuplicateDefinition:
35 return "Duplicate symbol definition";
36 case OrcErrorCode::JITSymbolNotFound:
37 return "JIT symbol not found";
38 case OrcErrorCode::RemoteAllocatorDoesNotExist:
39 return "Remote allocator does not exist";
40 case OrcErrorCode::RemoteAllocatorIdAlreadyInUse:
41 return "Remote allocator Id already in use";
42 case OrcErrorCode::RemoteMProtectAddrUnrecognized:
43 return "Remote mprotect call references unallocated memory";
44 case OrcErrorCode::RemoteIndirectStubsOwnerDoesNotExist:
45 return "Remote indirect stubs owner does not exist";
46 case OrcErrorCode::RemoteIndirectStubsOwnerIdAlreadyInUse:
47 return "Remote indirect stubs owner Id already in use";
48 case OrcErrorCode::RPCConnectionClosed:
49 return "RPC connection closed";
50 case OrcErrorCode::RPCCouldNotNegotiateFunction:
51 return "Could not negotiate RPC function";
52 case OrcErrorCode::RPCResponseAbandoned:
53 return "RPC response abandoned";
54 case OrcErrorCode::UnexpectedRPCCall:
55 return "Unexpected RPC call";
56 case OrcErrorCode::UnexpectedRPCResponse:
57 return "Unexpected RPC response";
58 case OrcErrorCode::UnknownErrorCodeFromRemote:
59 return "Unknown error returned from remote RPC function "
60 "(Use StringError to get error message)";
61 case OrcErrorCode::UnknownResourceHandle:
62 return "Unknown resource handle";
63 case OrcErrorCode::MissingSymbolDefinitions:
64 return "MissingSymbolsDefinitions";
65 case OrcErrorCode::UnexpectedSymbolDefinitions:
66 return "UnexpectedSymbolDefinitions";
72OrcErrorCategory &getOrcErrCat() {
73 static OrcErrorCategory OrcErrCat;
85 typedef std::underlying_type_t<OrcErrorCode> UT;
86 return std::error_code(
static_cast<UT
>(ErrCode), getOrcErrCat());
90 : SymbolName(
std::
move(SymbolName)) {}
97 OS <<
"Duplicate definition of symbol '" << SymbolName <<
"'";
105 : SymbolName(
std::
move(SymbolName)) {}
108 typedef std::underlying_type_t<OrcErrorCode> UT;
114 OS <<
"Could not find symbol '" << SymbolName <<
"'";
const std::string & getSymbolName() const
void log(raw_ostream &OS) const override
Print an error message to an output stream.
DuplicateDefinition(std::string SymbolName)
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
void log(raw_ostream &OS) const override
Print an error message to an output stream.
JITSymbolNotFound(std::string SymbolName)
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
const std::string & getSymbolName() const
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::error_code orcError(OrcErrorCode ErrCode)
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.