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 <system_error> 14 15namespace llvm { 16const std::error_category &obj2yaml_category(); 17 18enum class obj2yaml_error { 19 success = 0, 20 file_not_found, 21 unrecognized_file_format, 22 unsupported_obj_file_format 23}; 24 25inline std::error_code make_error_code(obj2yaml_error e) { 26 return std::error_code(static_cast<int>(e), obj2yaml_category()); 27} 28 29} // namespace llvm 30 31namespace std { 32template <> struct is_error_code_enum<llvm::obj2yaml_error> : std::true_type {}; 33} 34 35#endif 36