LLVM 19.0.0git
GenericError.h
Go to the documentation of this file.
1//===- GenericError.h - system_error extensions for PDB ---------*- 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_GENERICERROR_H
10#define LLVM_DEBUGINFO_PDB_GENERICERROR_H
11
12#include "llvm/Support/Error.h"
13
14namespace llvm {
15namespace pdb {
16
17enum class pdb_error_code {
24};
25} // namespace pdb
26} // namespace llvm
27
28namespace std {
29template <>
30struct is_error_code_enum<llvm::pdb::pdb_error_code> : std::true_type {};
31} // namespace std
32
33namespace llvm {
34namespace pdb {
35const std::error_category &PDBErrCategory();
36
37inline std::error_code make_error_code(pdb_error_code E) {
38 return std::error_code(static_cast<int>(E), PDBErrCategory());
39}
40
41/// Base class for errors originating when parsing raw PDB files
42class PDBError : public ErrorInfo<PDBError, StringError> {
43public:
44 using ErrorInfo<PDBError, StringError>::ErrorInfo; // inherit constructors
46 static char ID;
47};
48} // namespace pdb
49} // namespace llvm
50#endif
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Base class for user error types.
Definition: Error.h:352
This class wraps a string in an Error.
Definition: Error.h:1221
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
Base class for errors originating when parsing raw PDB files.
Definition: GenericError.h:42
PDBError(const Twine &S)
Definition: GenericError.h:45
std::error_code make_error_code(dia_error_code E)
Definition: DIAError.h:37
const std::error_category & PDBErrCategory()
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:858