1 //===- RawError.h - Error extensions for raw PDB implementation -*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_PDB_RAW_RAWERROR_H
10 #define LLVM_DEBUGINFO_PDB_RAW_RAWERROR_H
12 #include "llvm/Support/Error.h"
18 enum class raw_error_code
{
26 invalid_block_address
,
38 struct is_error_code_enum
<llvm::pdb::raw_error_code
> : std::true_type
{};
43 const std::error_category
&RawErrCategory();
45 inline std::error_code
make_error_code(raw_error_code E
) {
46 return std::error_code(static_cast<int>(E
), RawErrCategory());
49 /// Base class for errors originating when parsing raw PDB files
50 class RawError
: public ErrorInfo
<RawError
, StringError
> {
52 using ErrorInfo
<RawError
, StringError
>::ErrorInfo
; // inherit constructors
53 RawError(const Twine
&S
) : ErrorInfo(S
, raw_error_code::unspecified
) {}