summaryrefslogtreecommitdiff
path: root/include/llvm/DebugInfo/PDB/GenericError.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/DebugInfo/PDB/GenericError.h')
-rw-r--r--include/llvm/DebugInfo/PDB/GenericError.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/llvm/DebugInfo/PDB/GenericError.h b/include/llvm/DebugInfo/PDB/GenericError.h
new file mode 100644
index 0000000000000..959c261610442
--- /dev/null
+++ b/include/llvm/DebugInfo/PDB/GenericError.h
@@ -0,0 +1,42 @@
+//===- Error.h - system_error extensions for PDB ----------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_ERROR_H
+#define LLVM_DEBUGINFO_PDB_ERROR_H
+
+#include "llvm/Support/Error.h"
+
+namespace llvm {
+namespace pdb {
+
+enum class generic_error_code {
+ invalid_path = 1,
+ dia_sdk_not_present,
+ unspecified,
+};
+
+/// Base class for errors originating when parsing raw PDB files
+class GenericError : public ErrorInfo<GenericError> {
+public:
+ static char ID;
+ GenericError(generic_error_code C);
+ GenericError(const std::string &Context);
+ GenericError(generic_error_code C, const std::string &Context);
+
+ void log(raw_ostream &OS) const override;
+ const std::string &getErrorMessage() const;
+ std::error_code convertToErrorCode() const override;
+
+private:
+ std::string ErrMsg;
+ generic_error_code Code;
+};
+}
+}
+#endif