LLVM  4.0.0
GenericError.h
Go to the documentation of this file.
1 //===- Error.h - system_error extensions for PDB ----------------*- 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_ERROR_H
11 #define LLVM_DEBUGINFO_PDB_ERROR_H
12 
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/Error.h"
15 
16 namespace llvm {
17 namespace pdb {
18 
19 enum class generic_error_code {
20  invalid_path = 1,
23 };
24 
25 /// Base class for errors originating when parsing raw PDB files
26 class GenericError : public ErrorInfo<GenericError> {
27 public:
28  static char ID;
32 
33  void log(raw_ostream &OS) const override;
34  StringRef getErrorMessage() const;
35  std::error_code convertToErrorCode() const override;
36 
37 private:
38  std::string ErrMsg;
39  generic_error_code Code;
40 };
41 }
42 }
43 #endif
LLVMContext & Context
GenericError(generic_error_code C)
Base class for errors originating when parsing raw PDB files.
Definition: GenericError.h:26
StringRef getErrorMessage() const
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
Base class for user error types.
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
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.