1 //===------ OrcError.h - Reject symbol lookup requests ------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Define an error category, error codes, and helper utilities for Orc.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_EXECUTIONENGINE_ORC_ORCERROR_H
15 #define LLVM_EXECUTIONENGINE_ORC_ORCERROR_H
17 #include "llvm/Support/Error.h"
18 #include <system_error>
23 enum class OrcErrorCode : int {
28 RemoteAllocatorDoesNotExist,
29 RemoteAllocatorIdAlreadyInUse,
30 RemoteMProtectAddrUnrecognized,
31 RemoteIndirectStubsOwnerDoesNotExist,
32 RemoteIndirectStubsOwnerIdAlreadyInUse,
34 RPCCouldNotNegotiateFunction,
37 UnexpectedRPCResponse,
38 UnknownErrorCodeFromRemote,
42 std::error_code orcError(OrcErrorCode ErrCode);
44 class DuplicateDefinition : public ErrorInfo<DuplicateDefinition> {
48 DuplicateDefinition(std::string SymbolName);
49 std::error_code convertToErrorCode() const override;
50 void log(raw_ostream &OS) const override;
51 const std::string &getSymbolName() const;
53 std::string SymbolName;
56 class JITSymbolNotFound : public ErrorInfo<JITSymbolNotFound> {
60 JITSymbolNotFound(std::string SymbolName);
61 std::error_code convertToErrorCode() const override;
62 void log(raw_ostream &OS) const override;
63 const std::string &getSymbolName() const;
65 std::string SymbolName;
68 } // End namespace orc.
69 } // End namespace llvm.
71 #endif // LLVM_EXECUTIONENGINE_ORC_ORCERROR_H