Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:45

0001 //===- GenericError.h - system_error extensions for PDB ---------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_DEBUGINFO_PDB_GENERICERROR_H
0010 #define LLVM_DEBUGINFO_PDB_GENERICERROR_H
0011 
0012 #include "llvm/Support/Error.h"
0013 
0014 namespace llvm {
0015 namespace pdb {
0016 
0017 enum class pdb_error_code {
0018   invalid_utf8_path = 1,
0019   dia_sdk_not_present,
0020   dia_failed_loading,
0021   signature_out_of_date,
0022   no_matching_pch,
0023   unspecified,
0024 };
0025 } // namespace pdb
0026 } // namespace llvm
0027 
0028 namespace std {
0029 template <>
0030 struct is_error_code_enum<llvm::pdb::pdb_error_code> : std::true_type {};
0031 } // namespace std
0032 
0033 namespace llvm {
0034 namespace pdb {
0035 const std::error_category &PDBErrCategory();
0036 
0037 inline std::error_code make_error_code(pdb_error_code E) {
0038   return std::error_code(static_cast<int>(E), PDBErrCategory());
0039 }
0040 
0041 /// Base class for errors originating when parsing raw PDB files
0042 class PDBError : public ErrorInfo<PDBError, StringError> {
0043 public:
0044   using ErrorInfo<PDBError, StringError>::ErrorInfo; // inherit constructors
0045   PDBError(const Twine &S) : ErrorInfo(S, pdb_error_code::unspecified) {}
0046   static char ID;
0047 };
0048 } // namespace pdb
0049 } // namespace llvm
0050 #endif