LLVM 22.0.0git
BinaryStreamError.h
Go to the documentation of this file.
1//===- BinaryStreamError.h - Error extensions for Binary Streams *- 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_SUPPORT_BINARYSTREAMERROR_H
10#define LLVM_SUPPORT_BINARYSTREAMERROR_H
11
12#include "llvm/ADT/StringRef.h"
14#include "llvm/Support/Error.h"
15
16#include <string>
17
18namespace llvm {
25};
26
27/// Base class for errors originating when parsing raw PDB files
28class LLVM_ABI BinaryStreamError : public ErrorInfo<BinaryStreamError> {
29public:
30 static char ID;
32 explicit BinaryStreamError(StringRef Context);
34
35 void log(raw_ostream &OS) const override;
36 std::error_code convertToErrorCode() const override;
37
38 StringRef getErrorMessage() const;
39
40 stream_error_code getErrorCode() const { return Code; }
41
42private:
43 std::string ErrMsg;
45};
46} // namespace llvm
47
48#endif // LLVM_SUPPORT_BINARYSTREAMERROR_H
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
#define LLVM_ABI
Definition: Compiler.h:213
raw_pwrite_stream & OS
Base class for errors originating when parsing raw PDB files.
stream_error_code getErrorCode() const
Base class for user error types.
Definition: Error.h:354
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18