summaryrefslogtreecommitdiff
path: root/tools/llvm-vtabledump/Error.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-01-18 16:17:27 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-01-18 16:17:27 +0000
commit67c32a98315f785a9ec9d531c1f571a0196c7463 (patch)
tree4abb9cbeecc7901726dd0b4a37369596c852e9ef /tools/llvm-vtabledump/Error.h
parent9f61947910e6ab40de38e6b4034751ef1513200f (diff)
Diffstat (limited to 'tools/llvm-vtabledump/Error.h')
-rw-r--r--tools/llvm-vtabledump/Error.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/llvm-vtabledump/Error.h b/tools/llvm-vtabledump/Error.h
new file mode 100644
index 000000000000..fd8bb18994df
--- /dev/null
+++ b/tools/llvm-vtabledump/Error.h
@@ -0,0 +1,39 @@
+//===- Error.h - system_error extensions for llvm-vtabledump ----*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This declares a new error_category for the llvm-vtabledump tool.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TOOLS_LLVM_VTABLEDUMP_ERROR_H
+#define LLVM_TOOLS_LLVM_VTABLEDUMP_ERROR_H
+
+#include <system_error>
+
+namespace llvm {
+const std::error_category &vtabledump_category();
+
+enum class vtabledump_error {
+ success = 0,
+ file_not_found,
+ unrecognized_file_format,
+};
+
+inline std::error_code make_error_code(vtabledump_error e) {
+ return std::error_code(static_cast<int>(e), vtabledump_category());
+}
+
+} // namespace llvm
+
+namespace std {
+template <>
+struct is_error_code_enum<llvm::vtabledump_error> : std::true_type {};
+}
+
+#endif