LLVM 19.0.0git
MSFError.h
Go to the documentation of this file.
1//===- MSFError.h - Error extensions for MSF Files --------------*- 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_MSF_MSFERROR_H
10#define LLVM_DEBUGINFO_MSF_MSFERROR_H
11
12#include "llvm/Support/Error.h"
13
14namespace llvm {
15namespace msf {
16enum class msf_error_code {
17 unspecified = 1,
28};
29} // namespace msf
30} // namespace llvm
31
32namespace std {
33template <>
34struct is_error_code_enum<llvm::msf::msf_error_code> : std::true_type {};
35} // namespace std
36
37namespace llvm {
38namespace msf {
39const std::error_category &MSFErrCategory();
40
41inline std::error_code make_error_code(msf_error_code E) {
42 return std::error_code(static_cast<int>(E), MSFErrCategory());
43}
44
45/// Base class for errors originating when parsing raw PDB files
46class MSFError : public ErrorInfo<MSFError, StringError> {
47public:
48 using ErrorInfo<MSFError, StringError>::ErrorInfo; // inherit constructors
50
51 bool isPageOverflow() const {
52 switch (static_cast<msf_error_code>(convertToErrorCode().value())) {
59 return false;
65 return true;
66 }
67 llvm_unreachable("msf error code not implemented");
68 }
69
70 static char ID;
71};
72} // namespace msf
73} // namespace llvm
74
75#endif // LLVM_DEBUGINFO_MSF_MSFERROR_H
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Given that RA is a live value
Base class for user error types.
Definition: Error.h:352
This class wraps a string in an Error.
Definition: Error.h:1235
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
Definition: Error.cpp:148
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: MSFError.h:46
bool isPageOverflow() const
Definition: MSFError.h:51
static char ID
Definition: MSFError.h:70
MSFError(const Twine &S)
Definition: MSFError.h:49
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const std::error_category & MSFErrCategory()
Definition: MSFError.cpp:54
msf_error_code
Definition: MSFError.h:16
std::error_code make_error_code(msf_error_code E)
Definition: MSFError.h:41
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