LLVM  4.0.0
DIAError.h
Go to the documentation of this file.
1 //===- DIAError.h - Error extensions for PDB DIA 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_DIA_DIAERROR_H
11 #define LLVM_DEBUGINFO_PDB_DIA_DIAERROR_H
12 
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/Error.h"
15 
16 namespace llvm {
17 namespace pdb {
18 enum class dia_error_code {
19  unspecified = 1,
25 };
26 
27 /// Base class for errors originating in DIA SDK, e.g. COM calls
28 class DIAError : public ErrorInfo<DIAError> {
29 public:
30  static char ID;
34 
35  void log(raw_ostream &OS) const override;
36  StringRef getErrorMessage() const;
37  std::error_code convertToErrorCode() const override;
38 
39 private:
40  std::string ErrMsg;
41  dia_error_code Code;
42 };
43 }
44 }
45 #endif
LLVMContext & Context
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
Definition: DIAError.cpp:56
DIAError(dia_error_code C)
Definition: DIAError.cpp:39
dia_error_code
Definition: DIAError.h:18
static char ID
Definition: DIAError.h:30
StringRef getErrorMessage() const
Definition: DIAError.cpp:54
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
Base class for user error types.
Base class for errors originating in DIA SDK, e.g. COM calls.
Definition: DIAError.h:28
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47
void log(raw_ostream &OS) const override
Print an error message to an output stream.
Definition: DIAError.cpp:52