LLVM 19.0.0git
OrcError.h
Go to the documentation of this file.
1//===--------------- OrcError.h - Orc Error Types ---------------*- 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
21namespace llvm {
22namespace orc {
23
24enum class OrcErrorCode : int {
25 // RPC Errors
43};
44
45std::error_code orcError(OrcErrorCode ErrCode);
46
47class DuplicateDefinition : public ErrorInfo<DuplicateDefinition> {
48public:
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;
55private:
56 std::string SymbolName;
57};
58
59class JITSymbolNotFound : public ErrorInfo<JITSymbolNotFound> {
60public:
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;
67private:
68 std::string SymbolName;
69};
70
71} // End namespace orc.
72} // End namespace llvm.
73
74#endif // LLVM_EXECUTIONENGINE_ORC_SHARED_ORCERROR_H
raw_pwrite_stream & OS
Base class for user error types.
Definition: Error.h:352
const std::string & getSymbolName() const
Definition: OrcError.cpp:100
void log(raw_ostream &OS) const override
Print an error message to an output stream.
Definition: OrcError.cpp:96
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
Definition: OrcError.cpp:92
void log(raw_ostream &OS) const override
Print an error message to an output stream.
Definition: OrcError.cpp:113
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
Definition: OrcError.cpp:107
const std::string & getSymbolName() const
Definition: OrcError.cpp:117
Errors of this type should be returned if a module fails to include definitions that are claimed by t...
Definition: Core.h:499
Errors of this type should be returned if a module contains definitions for symbols that are not clai...
Definition: Core.h:522
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
OrcErrorCode
Definition: OrcError.h:24
std::error_code orcError(OrcErrorCode ErrCode)
Definition: OrcError.cpp:84
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18