llvm-project
39 строк · 1.1 Кб
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
14#include "llvm/TextAPI/TextAPIError.h"15
16using namespace llvm;17using namespace llvm::MachO;18
19char TextAPIError::ID = 0;20
21void TextAPIError::log(raw_ostream &OS) const {22switch (EC) {23case TextAPIErrorCode::NoSuchArchitecture:24OS << "no such architecture";25break;26case TextAPIErrorCode::InvalidInputFormat:27OS << "invalid input format";28break;29default:30llvm_unreachable("unhandled TextAPIErrorCode");31}32if (!Msg.empty())33OS << ": " << Msg;34OS << "\n";35}
36
37std::error_code TextAPIError::convertToErrorCode() const {38llvm_unreachable("convertToErrorCode is not supported.");39}
40