14 #include <system_error>
30 const char *
name()
const noexcept
override {
return "Error"; }
32 std::string message(
int condition)
const override {
33 switch (static_cast<ErrorErrorCode>(condition)) {
34 case ErrorErrorCode::MultipleErrors:
35 return "Multiple errors";
36 case ErrorErrorCode::InconvertibleError:
37 return "Inconvertible error value. An error has occurred that could "
38 "not be converted to a known std::error_code. Please file a "
51 void ErrorInfoBase::anchor() {}
52 char ErrorInfoBase::ID = 0;
69 return std::error_code(static_cast<int>(ErrorErrorCode::MultipleErrors),
74 return std::error_code(static_cast<int>(ErrorErrorCode::InconvertibleError),
95 : Msg(S.str()), EC(EC) {}
104 assert(Err &&
"report_fatal_error called with success value");
121 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
122 int EnableABIBreakingChecks;
int DisableABIBreakingChecks
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
void logAllUnhandledErrors(Error E, raw_ostream &OS, Twine ErrorBanner)
Log all errors (if any) in E to OS.
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
Base class for error info classes.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
virtual void log(raw_ostream &OS) const =0
Print an error message to an output stream.
void log(raw_ostream &OS) const override
Print an error message to an output stream.
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
static ManagedStatic< _object_error_category > error_category
void handleAllErrors(Error E, HandlerTs &&...Handlers)
Behaves the same as handleErrors, except that it requires that all errors be handled by the given han...
static ManagedStatic< ErrorErrorCategory > ErrorErrorCat
StringError(const Twine &S, std::error_code EC)
static ErrorSuccess success()
Create a success value.
virtual std::error_code convertToErrorCode() const =0
Convert this error to a std::error_code.
llvm_unreachable("Unknown RegBank!")
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A raw_ostream that writes to an std::string.
Lightweight error class with error context and mandatory checking.
This class wraps a std::error_code in a Error.
This class implements an extremely fast bulk output stream that can only output to a stream...
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
std::error_code errorToErrorCode(Error Err)
Helper for converting an ECError to a std::error_code.
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...