Remove system_error.h.
[oota-llvm.git] / include / llvm / Object / Error.h
1 //===- Error.h - system_error extensions for Object -------------*- 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 // This declares a new error_category for the Object library.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_OBJECT_ERROR_H
15 #define LLVM_OBJECT_ERROR_H
16
17 #include <system_error>
18
19 namespace llvm {
20 using std::error_code;
21 namespace object {
22
23 const std::error_category &object_category();
24
25 enum class object_error {
26   success = 0,
27   arch_not_found,
28   invalid_file_type,
29   parse_failed,
30   unexpected_eof
31 };
32
33 inline error_code make_error_code(object_error e) {
34   return error_code(static_cast<int>(e), object_category());
35 }
36
37 } // end namespace object.
38
39 } // end namespace llvm.
40
41 namespace std {
42 template <>
43 struct is_error_code_enum<llvm::object::object_error> : std::true_type {};
44 }
45
46 #endif