Error.h 887 B

1234567891011121314151617181920212223242526272829303132333435
  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. #ifndef LLVM_TOOLS_OBJ2YAML_ERROR_H
  10. #define LLVM_TOOLS_OBJ2YAML_ERROR_H
  11. #include <system_error>
  12. namespace llvm {
  13. const std::error_category &obj2yaml_category();
  14. enum class obj2yaml_error {
  15. success = 0,
  16. file_not_found,
  17. unrecognized_file_format,
  18. unsupported_obj_file_format
  19. };
  20. inline std::error_code make_error_code(obj2yaml_error e) {
  21. return std::error_code(static_cast<int>(e), obj2yaml_category());
  22. }
  23. } // namespace llvm
  24. namespace std {
  25. template <> struct is_error_code_enum<llvm::obj2yaml_error> : std::true_type {};
  26. }
  27. #endif