LLVM  9.0.0svn
Classes | Namespaces | Functions
Error.h File Reference
#include "llvm-c/Error.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Config/abi-breaking.h"
#include "llvm/Support/AlignOf.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstdlib>
#include <functional>
#include <memory>
#include <new>
#include <string>
#include <system_error>
#include <type_traits>
#include <utility>
#include <vector>
Include dependency graph for Error.h:

Go to the source code of this file.


class  llvm::ErrorInfoBase
 Base class for error info classes. More...
class  llvm::Error
 Lightweight error class with error context and mandatory checking. More...
class  llvm::ErrorSuccess
 Subclass of Error for the sole purpose of identifying the success path in the type system. More...
class  llvm::ErrorInfo< ThisErrT, ParentErrT >
 Base class for user error types. More...
class  llvm::ErrorList
 Special ErrorInfo subclass representing a list of ErrorInfos. More...
class  llvm::Expected< T >
 Tagged union holding either a T or a Error. More...
class  llvm::ErrorHandlerTraits< HandlerT >
 Helper for testing applicability of, and applying, handlers for ErrorInfo types. More...
class  llvm::ErrorHandlerTraits< Error(&)(ErrT &)>
class  llvm::ErrorHandlerTraits< void(&)(ErrT &)>
class  llvm::ErrorHandlerTraits< Error(&)(std::unique_ptr< ErrT >)>
 Specialization for functions of the form 'Error (std::unique_ptr<ErrT>)'. More...
class  llvm::ErrorHandlerTraits< void(&)(std::unique_ptr< ErrT >)>
 Specialization for functions of the form 'void (std::unique_ptr<ErrT>)'. More...
class  llvm::ErrorHandlerTraits< RetT(C::*)(ErrT &)>
class  llvm::ErrorHandlerTraits< RetT(C::*)(ErrT &) const >
class  llvm::ErrorHandlerTraits< RetT(C::*)(const ErrT &)>
class  llvm::ErrorHandlerTraits< RetT(C::*)(const ErrT &) const >
class  llvm::ErrorHandlerTraits< RetT(C::*)(std::unique_ptr< ErrT >)>
 Specialization for member functions of the form 'RetT (std::unique_ptr<ErrT>)'. More...
class  llvm::ErrorHandlerTraits< RetT(C::*)(std::unique_ptr< ErrT >) const >
 Specialization for member functions of the form 'RetT (std::unique_ptr<ErrT>) const'. More...
class  llvm::ErrorAsOutParameter
 Helper for Errors used as out-parameters. More...
class  llvm::ExpectedAsOutParameter< T >
 Helper for Expected<T>s used as out-parameters. More...
class  llvm::ECError
 This class wraps a std::error_code in a Error. More...
class  llvm::StringError
 This class wraps a string in an Error. More...
class  llvm::FileError
 This class wraps a filename and another Error. More...
class  llvm::ExitOnError
 Helper for check-and-exit error handling. More...


 This class represents lattice values for constants.


template<typename ErrT , typename... ArgTs>
Error llvm::make_error (ArgTs &&... Args)
 Make a Error instance representing failure using the given error info type. More...
Error llvm::joinErrors (Error E1, Error E2)
 Concatenate errors. More...
LLVM_ATTRIBUTE_NORETURN void llvm::report_fatal_error (Error Err, bool gen_crash_diag=true)
 Report a serious error, calling any installed error handler. More...
void llvm::cantFail (Error Err, const char *Msg=nullptr)
 Report a fatal error if Err is a failure value. More...
template<typename T >
T llvm::cantFail (Expected< T > ValOrErr, const char *Msg=nullptr)
 Report a fatal error if ValOrErr is a failure value, otherwise unwraps and returns the contained value. More...
template<typename T >
Tllvm::cantFail (Expected< T &> ValOrErr, const char *Msg=nullptr)
 Report a fatal error if ValOrErr is a failure value, otherwise unwraps and returns the contained reference. More...
Error llvm::handleErrorImpl (std::unique_ptr< ErrorInfoBase > Payload)
template<typename HandlerT , typename... HandlerTs>
Error llvm::handleErrorImpl (std::unique_ptr< ErrorInfoBase > Payload, HandlerT &&Handler, HandlerTs &&... Handlers)
template<typename... HandlerTs>
Error llvm::handleErrors (Error E, HandlerTs &&... Hs)
 Pass the ErrorInfo(s) contained in E to their respective handlers. More...
template<typename... HandlerTs>
void llvm::handleAllErrors (Error E, HandlerTs &&... Handlers)
 Behaves the same as handleErrors, except that by contract all errors must be handled by the given handlers (i.e. More...
void llvm::handleAllErrors (Error E)
 Check that E is a non-error, then drop it. More...
template<typename T , typename RecoveryFtor , typename... HandlerTs>
Expected< Tllvm::handleExpected (Expected< T > ValOrErr, RecoveryFtor &&RecoveryPath, HandlerTs &&... Handlers)
 Handle any errors (if present) in an Expected<T>, then try a recovery path. More...
void llvm::logAllUnhandledErrors (Error E, raw_ostream &OS, Twine ErrorBanner={})
 Log all errors (if any) in E to OS. More...
std::string llvm::toString (Error E)
 Write all error messages (if any) in E to a string. More...
void llvm::consumeError (Error Err)
 Consume a Error without doing anything. More...
bool llvm::errorToBool (Error Err)
 Helper for converting an Error to a bool. More...
std::error_code llvm::inconvertibleErrorCode ()
 The value returned by this function can be returned from convertToErrorCode for Error values where no sensible translation to std::error_code exists. More...
Error llvm::errorCodeToError (std::error_code EC)
 Helper for converting an std::error_code to a Error. More...
std::error_code llvm::errorToErrorCode (Error Err)
 Helper for converting an ECError to a std::error_code. More...
template<typename T >
Expected< Tllvm::errorOrToExpected (ErrorOr< T > &&EO)
 Convert an ErrorOr<T> to an Expected<T>. More...
template<typename T >
ErrorOr< Tllvm::expectedToErrorOr (Expected< T > &&E)
 Convert an Expected<T> to an ErrorOr<T>. More...
template<typename... Ts>
Error llvm::createStringError (std::error_code EC, char const *Fmt, const Ts &... Vals)
 Create formatted StringError object. More...
Error llvm::createStringError (std::error_code EC, char const *Msg)
Error llvm::createFileError (const Twine &F, Error E)
 Concatenate a source file path and/or name with an Error. More...
Error llvm::createFileError (const Twine &F, std::error_code EC)
 Concatenate a source file path and/or name with a std::error_code to form an Error object. More...
Error llvm::createFileError (const Twine &F, ErrorSuccess)=delete
LLVMErrorRef llvm::wrap (Error Err)
 Conversion from Error to LLVMErrorRef for C error bindings. More...
Error llvm::unwrap (LLVMErrorRef ErrRef)
 Conversion from LLVMErrorRef to Error for C error bindings. More...