LLVM  5.0.0
OrcError.h
Go to the documentation of this file.
1 //===------ OrcError.h - Reject symbol lookup requests ------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Define an error category, error codes, and helper utilities for Orc.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_EXECUTIONENGINE_ORC_ORCERROR_H
15 #define LLVM_EXECUTIONENGINE_ORC_ORCERROR_H
16 
17 #include "llvm/Support/Error.h"
18 #include <system_error>
19 
20 namespace llvm {
21 namespace orc {
22 
23 enum class OrcErrorCode : int {
24  // RPC Errors
37 };
38 
39 std::error_code orcError(OrcErrorCode ErrCode);
40 
41 class JITSymbolNotFound : public ErrorInfo<JITSymbolNotFound> {
42 public:
43  static char ID;
44 
45  JITSymbolNotFound(std::string SymbolName);
46  std::error_code convertToErrorCode() const override;
47  void log(raw_ostream &OS) const override;
48  const std::string &getSymbolName() const;
49 private:
50  std::string SymbolName;
51 };
52 
53 } // End namespace orc.
54 } // End namespace llvm.
55 
56 #endif // LLVM_EXECUTIONENGINE_ORC_ORCERROR_H
std::error_code orcError(OrcErrorCode ErrCode)
Definition: OrcError.cpp:70
void log(raw_ostream &OS) const override
Print an error message to an output stream.
Definition: OrcError.cpp:84
OrcErrorCode
Definition: OrcError.h:23
JITSymbolNotFound(std::string SymbolName)
Definition: OrcError.cpp:75
Base class for user error types.
Definition: Error.h:329
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
Definition: OrcError.cpp:78
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44
const std::string & getSymbolName() const
Definition: OrcError.cpp:88