LLVM  9.0.0svn
RawError.h
Go to the documentation of this file.
1 //===- RawError.h - Error extensions for raw PDB implementation -*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_DEBUGINFO_PDB_RAW_RAWERROR_H
10 #define LLVM_DEBUGINFO_PDB_RAW_RAWERROR_H
11 
12 #include "llvm/Support/Error.h"
13 
14 #include <string>
15 
16 namespace llvm {
17 namespace pdb {
18 enum class raw_error_code {
19  unspecified = 1,
24  no_stream,
28  no_entry,
32 };
33 } // namespace pdb
34 } // namespace llvm
35 
36 namespace std {
37 template <>
38 struct is_error_code_enum<llvm::pdb::raw_error_code> : std::true_type {};
39 } // namespace std
40 
41 namespace llvm {
42 namespace pdb {
44 
45 inline std::error_code make_error_code(raw_error_code E) {
46  return std::error_code(static_cast<int>(E), RawErrCategory());
47 }
48 
49 /// Base class for errors originating when parsing raw PDB files
50 class RawError : public ErrorInfo<RawError, StringError> {
51 public:
52  using ErrorInfo<RawError, StringError>::ErrorInfo; // inherit constructors
54  static char ID;
55 };
56 } // namespace pdb
57 } // namespace llvm
58 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:23
Base class for errors originating when parsing raw PDB files.
Definition: RawError.h:50
Definition: BitVector.h:937
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:80
raw_error_code
Definition: RawError.h:18
std::error_code make_error_code(dia_error_code E)
Definition: DIAError.h:37
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const std::error_category & RawErrCategory()
Definition: RawError.cpp:51
static ManagedStatic< _object_error_category > error_category
Definition: Error.cpp:74
Base class for user error types.
Definition: Error.h:344
RawError(const Twine &S)
Definition: RawError.h:53
static char ID
Definition: RawError.h:54