Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===- CodeViewError.h - Error extensions for CodeView ----------*- 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_CODEVIEW_CODEVIEWERROR_H
0010 #define LLVM_DEBUGINFO_CODEVIEW_CODEVIEWERROR_H
0011 
0012 #include "llvm/Support/Error.h"
0013 
0014 namespace llvm {
0015 namespace codeview {
0016 enum class cv_error_code {
0017   unspecified = 1,
0018   insufficient_buffer,
0019   operation_unsupported,
0020   corrupt_record,
0021   no_records,
0022   unknown_member_record,
0023 };
0024 } // namespace codeview
0025 } // namespace llvm
0026 
0027 namespace std {
0028 template <>
0029 struct is_error_code_enum<llvm::codeview::cv_error_code> : std::true_type {};
0030 } // namespace std
0031 
0032 namespace llvm {
0033 namespace codeview {
0034 const std::error_category &CVErrorCategory();
0035 
0036 inline std::error_code make_error_code(cv_error_code E) {
0037   return std::error_code(static_cast<int>(E), CVErrorCategory());
0038 }
0039 
0040 /// Base class for errors originating when parsing raw PDB files
0041 class CodeViewError : public ErrorInfo<CodeViewError, StringError> {
0042 public:
0043   using ErrorInfo<CodeViewError,
0044                   StringError>::ErrorInfo; // inherit constructors
0045   CodeViewError(const Twine &S) : ErrorInfo(S, cv_error_code::unspecified) {}
0046   static char ID;
0047 };
0048 
0049 } // namespace codeview
0050 } // namespace llvm
0051 
0052 #endif