1 //===- Error.h - system_error extensions for Object -------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This declares a new error_category for the Object library.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_OBJECT_ERROR_H
15 #define LLVM_OBJECT_ERROR_H
17 #include <system_error>
22 const std::error_category &object_category();
24 enum class object_error {
25 // Error code 0 is absent. Use std::error_code() instead.
30 string_table_non_null_end,
31 invalid_section_index,
32 bitcode_section_not_found,
33 elf_invalid_dynamic_table_size,
34 macho_small_load_command,
35 macho_load_segment_too_many_sections,
36 macho_load_segment_too_small,
39 inline std::error_code make_error_code(object_error e) {
40 return std::error_code(static_cast<int>(e), object_category());
43 } // end namespace object.
45 } // end namespace llvm.
49 struct is_error_code_enum<llvm::object::object_error> : std::true_type {};