LLVM 19.0.0git
TextAPIError.cpp
Go to the documentation of this file.
1//===- TextAPIError.cpp - 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 Implements TAPI Error.
11///
12//===----------------------------------------------------------------------===//
13
15
16using namespace llvm;
17using namespace llvm::MachO;
18
19char TextAPIError::ID = 0;
20
22 switch (EC) {
24 OS << "no such architecture";
25 break;
27 OS << "invalid input format";
28 break;
29 default:
30 llvm_unreachable("unhandled TextAPIErrorCode");
31 }
32 if (!Msg.empty())
33 OS << ": " << Msg;
34 OS << "\n";
35}
36
37std::error_code TextAPIError::convertToErrorCode() const {
38 llvm_unreachable("convertToErrorCode is not supported.");
39}
raw_pwrite_stream & OS
Define TAPI specific error codes.
void log(raw_ostream &OS) const override
Print an error message to an output stream.
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
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18