LLVM  4.0.0
CodeViewError.h
Go to the documentation of this file.
1 //===- CodeViewError.h - Error extensions for CodeView ----------*- 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_CODEVIEW_CODEVIEWERROR_H
11 #define LLVM_DEBUGINFO_PDB_CODEVIEW_CODEVIEWERROR_H
12 
13 #include "llvm/Support/Error.h"
14 
15 #include <string>
16 
17 namespace llvm {
18 namespace codeview {
19 enum class cv_error_code {
20  unspecified = 1,
25 };
26 
27 /// Base class for errors originating when parsing raw PDB files
28 class CodeViewError : public ErrorInfo<CodeViewError> {
29 public:
30  static char ID;
32  CodeViewError(const std::string &Context);
33  CodeViewError(cv_error_code C, const std::string &Context);
34 
35  void log(raw_ostream &OS) const override;
36  const std::string &getErrorMessage() const;
37  std::error_code convertToErrorCode() const override;
38 
39 private:
40  std::string ErrMsg;
41  cv_error_code Code;
42 };
43 }
44 }
45 #endif
LLVMContext & Context
Base class for errors originating when parsing raw PDB files.
Definition: CodeViewError.h:28
const std::string & getErrorMessage() const
Base class for user error types.
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
void log(raw_ostream &OS) const override
Print an error message to an output stream.
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44