LLVM 20.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
17#include "llvm/Support/Error.h"
18
19namespace llvm::MachO {
20enum class TextAPIErrorCode {
26};
27
28class TextAPIError : public llvm::ErrorInfo<TextAPIError> {
29public:
30 static char ID;
32 std::string Msg;
33
36 : EC(EC), Msg(std::move(Msg)) {}
37
38 void log(raw_ostream &OS) const override;
39 std::error_code convertToErrorCode() const override;
40};
41
42} // namespace llvm::MachO
43#endif // LLVM_TEXTAPI_TEXTAPIERROR_H
raw_pwrite_stream & OS
Base class for user error types.
Definition: Error.h:355
TextAPIError(TextAPIErrorCode EC)
Definition: TextAPIError.h:34
void log(raw_ostream &OS) const override
Print an error message to an output stream.
TextAPIError(TextAPIErrorCode EC, std::string Msg)
Definition: TextAPIError.h:35
TextAPIErrorCode EC
Definition: TextAPIError.h:31
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
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:1856
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:858