Path: blob/main/contrib/llvm-project/llvm/lib/TextAPI/TextAPIError.cpp
35262 views
//===- TextAPIError.cpp - Tapi Error ----------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7///8/// \file9/// \brief Implements TAPI Error.10///11//===----------------------------------------------------------------------===//1213#include "llvm/TextAPI/TextAPIError.h"1415using namespace llvm;16using namespace llvm::MachO;1718char TextAPIError::ID = 0;1920void TextAPIError::log(raw_ostream &OS) const {21switch (EC) {22case TextAPIErrorCode::NoSuchArchitecture:23OS << "no such architecture";24break;25case TextAPIErrorCode::InvalidInputFormat:26OS << "invalid input format";27break;28default:29llvm_unreachable("unhandled TextAPIErrorCode");30}31if (!Msg.empty())32OS << ": " << Msg;33OS << "\n";34}3536std::error_code TextAPIError::convertToErrorCode() const {37llvm_unreachable("convertToErrorCode is not supported.");38}394041