Files
Lang Hames b1e2ecc0ae [Orc][RPC] Add an RPCFunctionNotSupported error type and return it from
negotiateFunction where appropriate.

Replacing the old ECError with a custom type allows us to attach the name of
the function that could not be negotiated, enabling better diagnostics for
negotiation failures.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292055 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 06:34:25 +00:00

54 lines
1.5 KiB
C++

//===------ OrcError.h - Reject symbol lookup requests ------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Define an error category, error codes, and helper utilities for Orc.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_EXECUTIONENGINE_ORC_ORCERROR_H
#define LLVM_EXECUTIONENGINE_ORC_ORCERROR_H
#include "llvm/Support/Error.h"
#include <system_error>
namespace llvm {
namespace orc {
enum class OrcErrorCode : int {
// RPC Errors
RemoteAllocatorDoesNotExist = 1,
RemoteAllocatorIdAlreadyInUse,
RemoteMProtectAddrUnrecognized,
RemoteIndirectStubsOwnerDoesNotExist,
RemoteIndirectStubsOwnerIdAlreadyInUse,
RPCResponseAbandoned,
UnexpectedRPCCall,
UnexpectedRPCResponse,
UnknownRPCFunction
};
Error orcError(OrcErrorCode ErrCode);
class RPCFunctionNotSupported : public ErrorInfo<RPCFunctionNotSupported> {
public:
static char ID;
RPCFunctionNotSupported(std::string RPCFunctionSignature);
std::error_code convertToErrorCode() const override;
void log(raw_ostream &OS) const override;
const std::string &getFunctionSignature() const;
private:
std::string RPCFunctionSignature;
};
} // End namespace orc.
} // End namespace llvm.
#endif // LLVM_EXECUTIONENGINE_ORC_ORCERROR_H