1 //===- Error.h - system_error extensions for llvm-cxxdump -------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This declares a new error_category for the llvm-cxxdump tool.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_TOOLS_LLVM_CXXDUMP_ERROR_H
14 #define LLVM_TOOLS_LLVM_CXXDUMP_ERROR_H
16 #include <system_error>
19 const std::error_category
&cxxdump_category();
21 enum class cxxdump_error
{
24 unrecognized_file_format
,
27 inline std::error_code
make_error_code(cxxdump_error e
) {
28 return std::error_code(static_cast<int>(e
), cxxdump_category());
35 struct is_error_code_enum
<llvm::cxxdump_error
> : std::true_type
{};