Use std::error_code instead of llvm::error_code.
[oota-llvm.git] / tools / obj2yaml / Error.h
1 //===- Error.h - system_error extensions for obj2yaml -----------*- 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_TOOLS_ERROR_H
11 #define LLVM_TOOLS_ERROR_H
12
13 #include "llvm/Support/system_error.h"
14
15 namespace llvm {
16
17 const error_category &obj2yaml_category();
18
19 enum class obj2yaml_error {
20   success = 0,
21   file_not_found,
22   unrecognized_file_format,
23   unsupported_obj_file_format
24 };
25
26 inline error_code make_error_code(obj2yaml_error e) {
27   return error_code(static_cast<int>(e), obj2yaml_category());
28 }
29
30 } // namespace llvm
31
32 namespace std {
33 template <> struct is_error_code_enum<llvm::obj2yaml_error> : std::true_type {};
34 }
35
36 #endif