18using namespace object;
24class _object_error_category :
public std::error_category {
26 const char*
name()
const noexcept override;
27 std::
string message(
int ev)
const override;
35std::string _object_error_category::message(
int EV)
const {
38 case object_error::arch_not_found:
39 return "No object file for requested architecture";
40 case object_error::invalid_file_type:
41 return "The file was not recognized as a valid object file";
42 case object_error::parse_failed:
43 return "Invalid data was encountered while parsing the file";
44 case object_error::unexpected_eof:
45 return "The end of the file was unexpectedly encountered";
46 case object_error::string_table_non_null_end:
47 return "String table must end with a null terminator";
48 case object_error::invalid_section_index:
49 return "Invalid section index";
50 case object_error::bitcode_section_not_found:
51 return "Bitcode section not found in object file";
52 case object_error::invalid_symbol_index:
53 return "Invalid symbol index";
54 case object_error::section_stripped:
55 return "Section has been stripped from the object file";
61void BinaryError::anchor() {}
78 static _object_error_category error_category;
79 return error_category;
92 return Error(std::move(M));
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
void log(raw_ostream &OS) const override
GenericBinaryError(const Twine &Msg)
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::error_code make_error_code(object_error e)
const std::error_category & object_category()
Error isNotObjectErrorInvalidFileType(llvm::Error Err)
isNotObjectErrorInvalidFileType() is used when looping through the children of an archive after calli...
This is an optimization pass for GlobalISel generic memory operations.
Error handleErrors(Error E, HandlerTs &&... Hs)
Pass the ErrorInfo(s) contained in E to their respective handlers.
Implement std::hash so that hash_code can be used in STL containers.