LLVM 22.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
13#include "llvm/Support/Error.h"
14
15namespace llvm {
16namespace pdb {
17
26} // namespace pdb
27} // namespace llvm
28
29namespace std {
30template <>
31struct is_error_code_enum<llvm::pdb::pdb_error_code> : std::true_type {};
32} // namespace std
33
34namespace llvm {
35namespace pdb {
36LLVM_ABI const std::error_category &PDBErrCategory();
37
38inline std::error_code make_error_code(pdb_error_code E) {
39 return std::error_code(static_cast<int>(E), PDBErrCategory());
40}
41
42/// Base class for errors originating when parsing raw PDB files
43class PDBError : public ErrorInfo<PDBError, StringError> {
44public:
45 using ErrorInfo<PDBError, StringError>::ErrorInfo; // inherit constructors
47 LLVM_ABI static char ID;
48};
49} // namespace pdb
50} // namespace llvm
51#endif
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define LLVM_ABI
Definition Compiler.h:213
Base class for user error types.
Definition Error.h:354
StringError(std::string &&S, std::error_code EC, bool PrintMsgOnly)
Definition Error.cpp:146
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition Twine.h:82
PDBError(const Twine &S)
static LLVM_ABI char ID
std::error_code make_error_code(dia_error_code E)
Definition DIAError.h:37
LLVM_ABI const std::error_category & PDBErrCategory()
This is an optimization pass for GlobalISel generic memory operations.
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:851