Error.cpp (225736) | Error.cpp (263509) |
---|---|
1//===- Error.cpp - system_error extensions for Object -----------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 17 unchanged lines hidden (view full) --- 26}; 27} 28 29const char *_object_error_category::name() const { 30 return "llvm.object"; 31} 32 33std::string _object_error_category::message(int ev) const { | 1//===- Error.cpp - system_error extensions for Object -----------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 17 unchanged lines hidden (view full) --- 26}; 27} 28 29const char *_object_error_category::name() const { 30 return "llvm.object"; 31} 32 33std::string _object_error_category::message(int ev) const { |
34 switch (ev) { | 34 object_error::Impl E = static_cast<object_error::Impl>(ev); 35 switch (E) { |
35 case object_error::success: return "Success"; | 36 case object_error::success: return "Success"; |
37 case object_error::arch_not_found: 38 return "No object file for requested architecture"; |
|
36 case object_error::invalid_file_type: 37 return "The file was not recognized as a valid object file"; 38 case object_error::parse_failed: 39 return "Invalid data was encountered while parsing the file"; 40 case object_error::unexpected_eof: 41 return "The end of the file was unexpectedly encountered"; | 39 case object_error::invalid_file_type: 40 return "The file was not recognized as a valid object file"; 41 case object_error::parse_failed: 42 return "Invalid data was encountered while parsing the file"; 43 case object_error::unexpected_eof: 44 return "The end of the file was unexpectedly encountered"; |
42 default: 43 llvm_unreachable("An enumerator of object_error does not have a message " 44 "defined."); | |
45 } | 45 } |
46 llvm_unreachable("An enumerator of object_error does not have a message " 47 "defined."); |
|
46} 47 48error_condition _object_error_category::default_error_condition(int ev) const { 49 if (ev == object_error::success) 50 return errc::success; 51 return errc::invalid_argument; 52} 53 54const error_category &object::object_category() { 55 static _object_error_category o; 56 return o; 57} | 48} 49 50error_condition _object_error_category::default_error_condition(int ev) const { 51 if (ev == object_error::success) 52 return errc::success; 53 return errc::invalid_argument; 54} 55 56const error_category &object::object_category() { 57 static _object_error_category o; 58 return o; 59} |