summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj/Error.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-readobj/Error.cpp')
-rw-r--r--llvm/tools/llvm-readobj/Error.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/tools/llvm-readobj/Error.cpp b/llvm/tools/llvm-readobj/Error.cpp
index 424dfbea06b..a68ebeb58e7 100644
--- a/llvm/tools/llvm-readobj/Error.cpp
+++ b/llvm/tools/llvm-readobj/Error.cpp
@@ -29,8 +29,8 @@ const char *_readobj_error_category::name() const {
return "llvm.readobj";
}
-std::string _readobj_error_category::message(int ev) const {
- switch (ev) {
+std::string _readobj_error_category::message(int EV) const {
+ switch (static_cast<readobj_error>(EV)) {
case readobj_error::success: return "Success";
case readobj_error::file_not_found:
return "No such file.";
@@ -42,14 +42,13 @@ std::string _readobj_error_category::message(int ev) const {
return "Unsupported object file format.";
case readobj_error::unknown_symbol:
return "Unknown symbol.";
- default:
- llvm_unreachable("An enumerator of readobj_error does not have a message "
- "defined.");
}
+ llvm_unreachable("An enumerator of readobj_error does not have a message "
+ "defined.");
}
-error_condition _readobj_error_category::default_error_condition(int ev) const {
- if (ev == readobj_error::success)
+error_condition _readobj_error_category::default_error_condition(int EV) const {
+ if (static_cast<readobj_error>(EV) == readobj_error::success)
return error_condition();
return errc::invalid_argument;
}
OpenPOWER on IntegriCloud