LLVM  4.0.0
RawError.h
Go to the documentation of this file.
1 //===- RawError.h - Error extensions for raw PDB implementation -*- 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_DEBUGINFO_PDB_RAW_RAWERROR_H
11 #define LLVM_DEBUGINFO_PDB_RAW_RAWERROR_H
12 
13 #include "llvm/Support/Error.h"
14 
15 #include <string>
16 
17 namespace llvm {
18 namespace pdb {
19 enum class raw_error_code {
20  unspecified = 1,
25  no_stream,
29  no_entry,
32 };
33 
34 /// Base class for errors originating when parsing raw PDB files
35 class RawError : public ErrorInfo<RawError> {
36 public:
37  static char ID;
39  RawError(const std::string &Context);
40  RawError(raw_error_code C, const std::string &Context);
41 
42  void log(raw_ostream &OS) const override;
43  const std::string &getErrorMessage() const;
44  std::error_code convertToErrorCode() const override;
45 
46 private:
47  std::string ErrMsg;
48  raw_error_code Code;
49 };
50 }
51 }
52 #endif
const std::string & getErrorMessage() const
Definition: RawError.cpp:69
LLVMContext & Context
Base class for errors originating when parsing raw PDB files.
Definition: RawError.h:35
raw_error_code
Definition: RawError.h:19
void log(raw_ostream &OS) const override
Print an error message to an output stream.
Definition: RawError.cpp:67
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
Definition: RawError.cpp:71
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
Base class for user error types.
RawError(raw_error_code C)
Definition: RawError.cpp:53
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44
static char ID
Definition: RawError.h:37