LLVM 22.0.0git
VirtualOutputError.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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/// This file implements the errors for output virtualization.
11///
12//===----------------------------------------------------------------------===//
13
15
16using namespace llvm;
17using namespace llvm::vfs;
18
19void OutputError::anchor() {}
20void OutputConfigError::anchor() {}
21void TempFileOutputError::anchor() {}
22
23char OutputError::ID = 0;
26
28 OS << getOutputPath() << ": ";
29 ECError::log(OS);
30}
31
34 OS << ": " << Config;
35}
36
38 OS << getTempPath() << " => ";
40}
41
42namespace {
43class OutputErrorCategory : public std::error_category {
44public:
45 const char *name() const noexcept override;
46 std::string message(int EV) const override;
47};
48} // end namespace
49
50const std::error_category &vfs::output_category() {
51 static OutputErrorCategory ErrorCategory;
52 return ErrorCategory;
53}
54
55const char *OutputErrorCategory::name() const noexcept {
56 return "llvm.vfs.output";
57}
58
59std::string OutputErrorCategory::message(int EV) const {
60 OutputErrorCode E = static_cast<OutputErrorCode>(EV);
61 switch (E) {
63 return "invalid config";
65 return "output not closed";
67 return "output already closed";
69 return "output has open proxy";
70 }
72 "An enumerator of OutputErrorCode does not have a message defined.");
73}
aarch64 promote const
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static const char * name
This file contains the declarations of the OutputError class.
void log(raw_ostream &OS) const override
Print an error message to an output stream.
Definition Error.h:1201
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
void log(raw_ostream &OS) const override
StringRef getOutputPath() const
void log(raw_ostream &OS) const override
Print an error message to an output stream.
void log(raw_ostream &OS) const override
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const std::error_category & output_category()
This is an optimization pass for GlobalISel generic memory operations.
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:851