]> git.proxmox.com Git - rustc.git/blame - src/llvm/tools/llvm-vtabledump/Error.h
Imported Upstream version 1.0.0+dfsg1
[rustc.git] / src / llvm / tools / llvm-vtabledump / Error.h
CommitLineData
1a4d82fc
JJ
1//===- Error.h - system_error extensions for llvm-vtabledump ----*- 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 llvm-vtabledump tool.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TOOLS_LLVM_VTABLEDUMP_ERROR_H
15#define LLVM_TOOLS_LLVM_VTABLEDUMP_ERROR_H
16
17#include <system_error>
18
19namespace llvm {
20const std::error_category &vtabledump_category();
21
22enum class vtabledump_error {
23 success = 0,
24 file_not_found,
25 unrecognized_file_format,
26};
27
28inline std::error_code make_error_code(vtabledump_error e) {
29 return std::error_code(static_cast<int>(e), vtabledump_category());
30}
31
32} // namespace llvm
33
34namespace std {
35template <>
36struct is_error_code_enum<llvm::vtabledump_error> : std::true_type {};
37}
38
39#endif