1 //===- Error.h - system_error extensions for llvm-readobj -------*- 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 llvm-readobj tool.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_TOOLS_LLVM_READOBJ_ERROR_H
15 #define LLVM_TOOLS_LLVM_READOBJ_ERROR_H
17 #include <system_error>
20 const std::error_category
&readobj_category();
22 enum class readobj_error
{
25 unsupported_file_format
,
26 unrecognized_file_format
,
27 unsupported_obj_file_format
,
31 inline std::error_code
make_error_code(readobj_error e
) {
32 return std::error_code(static_cast<int>(e
), readobj_category());
38 template <> struct is_error_code_enum
<llvm::readobj_error
> : std::true_type
{};