1 //===- Error.h - system_error extensions for PDB ----------------*- 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_ERROR_H
11 #define LLVM_DEBUGINFO_PDB_ERROR_H
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/Error.h"
19 enum class pdb_error_code {
20 invalid_utf8_path = 1,
23 signature_out_of_date,
32 struct is_error_code_enum<llvm::pdb::pdb_error_code> : std::true_type {};
37 const std::error_category &PDBErrCategory();
39 inline std::error_code make_error_code(pdb_error_code E) {
40 return std::error_code(static_cast<int>(E), PDBErrCategory());
43 /// Base class for errors originating when parsing raw PDB files
44 class PDBError : public ErrorInfo<PDBError, StringError> {
46 using ErrorInfo<PDBError, StringError>::ErrorInfo; // inherit constructors
47 PDBError(const Twine &S) : ErrorInfo(S, pdb_error_code::unspecified) {}