Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===- RawError.h - Error extensions for raw PDB 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_NATIVE_RAWERROR_H
0010 #define LLVM_DEBUGINFO_PDB_NATIVE_RAWERROR_H
0011 
0012 #include "llvm/Support/Error.h"
0013 
0014 namespace llvm {
0015 namespace pdb {
0016 enum class raw_error_code {
0017   unspecified = 1,
0018   feature_unsupported,
0019   invalid_format,
0020   corrupt_file,
0021   insufficient_buffer,
0022   no_stream,
0023   index_out_of_bounds,
0024   invalid_block_address,
0025   duplicate_entry,
0026   no_entry,
0027   not_writable,
0028   stream_too_long,
0029   invalid_tpi_hash,
0030 };
0031 } // namespace pdb
0032 } // namespace llvm
0033 
0034 namespace std {
0035 template <>
0036 struct is_error_code_enum<llvm::pdb::raw_error_code> : std::true_type {};
0037 } // namespace std
0038 
0039 namespace llvm {
0040 namespace pdb {
0041 const std::error_category &RawErrCategory();
0042 
0043 inline std::error_code make_error_code(raw_error_code E) {
0044   return std::error_code(static_cast<int>(E), RawErrCategory());
0045 }
0046 
0047 /// Base class for errors originating when parsing raw PDB files
0048 class RawError : public ErrorInfo<RawError, StringError> {
0049 public:
0050   using ErrorInfo<RawError, StringError>::ErrorInfo; // inherit constructors
0051   RawError(const Twine &S) : ErrorInfo(S, raw_error_code::unspecified) {}
0052   static char ID;
0053 };
0054 } // namespace pdb
0055 } // namespace llvm
0056 #endif