LLVM  8.0.1
BinaryStreamError.h
Go to the documentation of this file.
1 //===- BinaryStreamError.h - Error extensions for Binary Streams *- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_SUPPORT_BINARYSTREAMERROR_H
11 #define LLVM_SUPPORT_BINARYSTREAMERROR_H
12 
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/Error.h"
15 
16 #include <string>
17 
18 namespace llvm {
19 enum class stream_error_code {
25 };
26 
27 /// Base class for errors originating when parsing raw PDB files
28 class BinaryStreamError : public ErrorInfo<BinaryStreamError> {
29 public:
30  static char ID;
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 
42 private:
43  std::string ErrMsg;
44  stream_error_code Code;
45 };
46 } // namespace llvm
47 
48 #endif // LLVM_SUPPORT_BINARYSTREAMERROR_H
uint64_t CallInst * C
LLVMContext & Context
This class represents lattice values for constants.
Definition: AllocatorList.h:24
Base class for user error types.
Definition: Error.h:345
Base class for errors originating when parsing raw PDB files.
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46
stream_error_code getErrorCode() const
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49