LLVM: lib/Support/BinaryStreamError.cpp Source File (original) (raw)
Go to the documentation of this file.
1
2
3
4
5
6
7
8
11
12using namespace llvm;
13
15
18
21
23 : Code(C) {
24 ErrMsg = "Stream Error: ";
25 switch (C) {
27 ErrMsg += "An unspecified error has occurred.";
28 break;
30 ErrMsg += "The stream is too short to perform the requested operation.";
31 break;
33 ErrMsg += "The buffer size is not a multiple of the array element size.";
34 break;
36 ErrMsg += "The specified offset is invalid for the current stream.";
37 break;
39 ErrMsg += "An I/O error occurred on the file system.";
40 break;
41 }
42
43 if (!Context.empty()) {
44 ErrMsg += " ";
45 ErrMsg += Context;
46 }
47}
48
50
52
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
Definition BinaryStreamError.cpp:53
BinaryStreamError(stream_error_code C)
Definition BinaryStreamError.cpp:16
void log(raw_ostream &OS) const override
Print an error message to an output stream.
Definition BinaryStreamError.cpp:49
StringRef getErrorMessage() const
Definition BinaryStreamError.cpp:51
StringRef - Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...