Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===- DIAError.h - Error extensions for PDB DIA implementation -*- 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_DIA_DIAERROR_H
0010 #define LLVM_DEBUGINFO_PDB_DIA_DIAERROR_H
0011 
0012 #include "llvm/ADT/StringRef.h"
0013 #include "llvm/Support/Error.h"
0014 
0015 namespace llvm {
0016 namespace pdb {
0017 enum class dia_error_code {
0018   unspecified = 1,
0019   could_not_create_impl,
0020   invalid_file_format,
0021   invalid_parameter,
0022   already_loaded,
0023   debug_info_mismatch,
0024 };
0025 } // namespace pdb
0026 } // namespace llvm
0027 
0028 namespace std {
0029 template <>
0030 struct is_error_code_enum<llvm::pdb::dia_error_code> : std::true_type {};
0031 } // namespace std
0032 
0033 namespace llvm {
0034 namespace pdb {
0035 const std::error_category &DIAErrCategory();
0036 
0037 inline std::error_code make_error_code(dia_error_code E) {
0038   return std::error_code(static_cast<int>(E), DIAErrCategory());
0039 }
0040 
0041 /// Base class for errors originating in DIA SDK, e.g. COM calls
0042 class DIAError : public ErrorInfo<DIAError, StringError> {
0043 public:
0044   using ErrorInfo<DIAError, StringError>::ErrorInfo;
0045   DIAError(const Twine &S) : ErrorInfo(S, dia_error_code::unspecified) {}
0046   static char ID;
0047 };
0048 } // namespace pdb
0049 } // namespace llvm
0050 #endif