LLVM 22.0.0git
TextAPIError.h
Go to the documentation of this file.
1//===- llvm/TextAPI/TextAPIError.h - TAPI Error -----------------*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// \brief Define TAPI specific error codes.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TEXTAPI_TEXTAPIERROR_H
15#define LLVM_TEXTAPI_TEXTAPIERROR_H
16
18#include "llvm/Support/Error.h"
19
20namespace llvm::MachO {
21enum class TextAPIErrorCode {
27};
28
29class LLVM_ABI TextAPIError : public llvm::ErrorInfo<TextAPIError> {
30public:
31 static char ID;
33 std::string Msg;
34
36 TextAPIError(TextAPIErrorCode EC, std::string Msg)
37 : EC(EC), Msg(std::move(Msg)) {}
38
39 void log(raw_ostream &OS) const override;
40 std::error_code convertToErrorCode() const override;
41};
42
43} // namespace llvm::MachO
44#endif // LLVM_TEXTAPI_TEXTAPIERROR_H
#define LLVM_ABI
Definition: Compiler.h:213
raw_pwrite_stream & OS
Base class for user error types.
Definition: Error.h:354
TextAPIError(TextAPIErrorCode EC)
Definition: TextAPIError.h:35
TextAPIError(TextAPIErrorCode EC, std::string Msg)
Definition: TextAPIError.h:36
TextAPIErrorCode EC
Definition: TextAPIError.h:32
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1886
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:851