1 //===- RawError.h - Error extensions for raw PDB implementation -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_PDB_RAW_RAWERROR_H
11 #define LLVM_DEBUGINFO_PDB_RAW_RAWERROR_H
13 #include "llvm/Support/Error.h"
19 enum class raw_error_code {
27 invalid_block_address,
39 struct is_error_code_enum<llvm::pdb::raw_error_code> : std::true_type {};
44 const std::error_category &RawErrCategory();
46 inline std::error_code make_error_code(raw_error_code E) {
47 return std::error_code(static_cast<int>(E), RawErrCategory());
50 /// Base class for errors originating when parsing raw PDB files
51 class RawError : public ErrorInfo<RawError, StringError> {
53 using ErrorInfo<RawError, StringError>::ErrorInfo; // inherit constructors
54 RawError(const Twine &S) : ErrorInfo(S, raw_error_code::unspecified) {}