xref: /llvm-project/llvm/lib/TextAPI/TextAPIError.cpp (revision 16c1f43642e40dbc0d59fcf68ed1682dbf4d87bd)
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 
16 using namespace llvm;
17 using namespace llvm::MachO;
18 
19 char TextAPIError::ID = 0;
20 
21 void TextAPIError::log(raw_ostream &OS) const {
22   switch (EC) {
23   case TextAPIErrorCode::NoSuchArchitecture:
24     OS << "no such architecture\n";
25     return;
26   default:
27     llvm_unreachable("unhandled TextAPIErrorCode");
28   }
29 }
30 
31 std::error_code TextAPIError::convertToErrorCode() const {
32   llvm_unreachable("convertToErrorCode is not supported.");
33 }
34