LLVM  13.0.0git
OrcError.h
Go to the documentation of this file.
1 //===------ OrcError.h - Reject symbol lookup requests ------*- C++ -*-===//
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 // Define an error category, error codes, and helper utilities for Orc.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_ORCERROR_H
14 #define LLVM_EXECUTIONENGINE_ORC_SHARED_ORCERROR_H
15 
16 #include "llvm/Support/Error.h"
18 #include <string>
19 #include <system_error>
20 
21 namespace llvm {
22 namespace orc {
23 
24 enum class OrcErrorCode : int {
25  // RPC Errors
26  UnknownORCError = 1,
43 };
44 
45 std::error_code orcError(OrcErrorCode ErrCode);
46 
47 class DuplicateDefinition : public ErrorInfo<DuplicateDefinition> {
48 public:
49  static char ID;
50 
51  DuplicateDefinition(std::string SymbolName);
52  std::error_code convertToErrorCode() const override;
53  void log(raw_ostream &OS) const override;
54  const std::string &getSymbolName() const;
55 private:
56  std::string SymbolName;
57 };
58 
59 class JITSymbolNotFound : public ErrorInfo<JITSymbolNotFound> {
60 public:
61  static char ID;
62 
63  JITSymbolNotFound(std::string SymbolName);
64  std::error_code convertToErrorCode() const override;
65  void log(raw_ostream &OS) const override;
66  const std::string &getSymbolName() const;
67 private:
68  std::string SymbolName;
69 };
70 
71 } // End namespace orc.
72 } // End namespace llvm.
73 
74 #endif // LLVM_EXECUTIONENGINE_ORC_SHARED_ORCERROR_H
llvm::orc::DuplicateDefinition::getSymbolName
const std::string & getSymbolName() const
Definition: OrcError.cpp:98
llvm
This class represents lattice values for constants.
Definition: AllocatorList.h:23
llvm::orc::JITSymbolNotFound::log
void log(raw_ostream &OS) const override
Print an error message to an output stream.
Definition: OrcError.cpp:111
llvm::orc::JITSymbolNotFound::ID
static char ID
Definition: OrcError.h:61
llvm::orc::OrcErrorCode::JITSymbolNotFound
@ JITSymbolNotFound
llvm::orc::OrcErrorCode::UnknownORCError
@ UnknownORCError
llvm::orc::OrcErrorCode::RPCConnectionClosed
@ RPCConnectionClosed
Error.h
llvm::orc::OrcErrorCode::DuplicateDefinition
@ DuplicateDefinition
llvm::orc::OrcErrorCode::RemoteIndirectStubsOwnerDoesNotExist
@ RemoteIndirectStubsOwnerDoesNotExist
llvm::orc::JITSymbolNotFound::getSymbolName
const std::string & getSymbolName() const
Definition: OrcError.cpp:115
llvm::orc::orcError
std::error_code orcError(OrcErrorCode ErrCode)
Definition: OrcError.cpp:82
llvm::orc::OrcErrorCode::RemoteAllocatorIdAlreadyInUse
@ RemoteAllocatorIdAlreadyInUse
llvm::orc::OrcErrorCode::RPCCouldNotNegotiateFunction
@ RPCCouldNotNegotiateFunction
int
Clang compiles this i1 i64 store i64 i64 store i64 i64 store i64 i64 store i64 align Which gets codegen d xmm0 movaps rbp movaps rbp movaps rbp movaps rbp rbp rbp rbp rbp It would be better to have movq s of instead of the movaps s LLVM produces ret int
Definition: README.txt:536
llvm::orc::OrcErrorCode::UnexpectedSymbolDefinitions
@ UnexpectedSymbolDefinitions
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:50
llvm::orc::DuplicateDefinition::ID
static char ID
Definition: OrcError.h:49
llvm::orc::OrcErrorCode::RPCResponseAbandoned
@ RPCResponseAbandoned
llvm::orc::DuplicateDefinition
Definition: OrcError.h:47
llvm::orc::OrcErrorCode
OrcErrorCode
Definition: OrcError.h:24
llvm::orc::OrcErrorCode::RemoteAllocatorDoesNotExist
@ RemoteAllocatorDoesNotExist
llvm::orc::OrcErrorCode::UnknownResourceHandle
@ UnknownResourceHandle
llvm::orc::OrcErrorCode::RemoteMProtectAddrUnrecognized
@ RemoteMProtectAddrUnrecognized
llvm::orc::JITSymbolNotFound
Definition: OrcError.h:59
llvm::orc::OrcErrorCode::RemoteIndirectStubsOwnerIdAlreadyInUse
@ RemoteIndirectStubsOwnerIdAlreadyInUse
llvm::orc::JITSymbolNotFound::convertToErrorCode
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
Definition: OrcError.cpp:105
llvm::ErrorInfo
Base class for user error types.
Definition: Error.h:350
llvm::orc::JITSymbolNotFound::JITSymbolNotFound
JITSymbolNotFound(std::string SymbolName)
Definition: OrcError.cpp:102
llvm::orc::DuplicateDefinition::log
void log(raw_ostream &OS) const override
Print an error message to an output stream.
Definition: OrcError.cpp:94
llvm::orc::OrcErrorCode::UnexpectedRPCCall
@ UnexpectedRPCCall
llvm::orc::OrcErrorCode::UnknownErrorCodeFromRemote
@ UnknownErrorCodeFromRemote
llvm::orc::OrcErrorCode::UnexpectedRPCResponse
@ UnexpectedRPCResponse
llvm::orc::DuplicateDefinition::DuplicateDefinition
DuplicateDefinition(std::string SymbolName)
Definition: OrcError.cpp:87
llvm::orc::DuplicateDefinition::convertToErrorCode
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
Definition: OrcError.cpp:90
raw_ostream.h
llvm::orc::OrcErrorCode::MissingSymbolDefinitions
@ MissingSymbolDefinitions