1 //===- DIAError.h - Error extensions for PDB DIA implementation -*- 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 #ifndef LLVM_DEBUGINFO_PDB_DIA_DIAERROR_H
10 #define LLVM_DEBUGINFO_PDB_DIA_DIAERROR_H
12 #include "llvm/ADT/StringRef.h"
13 #include "llvm/Support/Error.h"
17 enum class dia_error_code
{
19 could_not_create_impl
,
30 struct is_error_code_enum
<llvm::pdb::dia_error_code
> : std::true_type
{};
35 const std::error_category
&DIAErrCategory();
37 inline std::error_code
make_error_code(dia_error_code E
) {
38 return std::error_code(static_cast<int>(E
), DIAErrCategory());
41 /// Base class for errors originating in DIA SDK, e.g. COM calls
42 class DIAError
: public ErrorInfo
<DIAError
, StringError
> {
44 using ErrorInfo
<DIAError
, StringError
>::ErrorInfo
;
45 DIAError(const Twine
&S
) : ErrorInfo(S
, dia_error_code::unspecified
) {}