Use an enum class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210078 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-06-03 05:26:12 +00:00
parent 18b4087194
commit b468431b37
2 changed files with 10 additions and 19 deletions

View File

@ -30,8 +30,8 @@ const char *_object_error_category::name() const {
return "llvm.object";
}
std::string _object_error_category::message(int ev) const {
object_error::Impl E = static_cast<object_error::Impl>(ev);
std::string _object_error_category::message(int EV) const {
object_error E = static_cast<object_error>(EV);
switch (E) {
case object_error::success: return "Success";
case object_error::arch_not_found:
@ -47,8 +47,8 @@ std::string _object_error_category::message(int ev) const {
"defined.");
}
error_condition _object_error_category::default_error_condition(int ev) const {
if (ev == object_error::success)
error_condition _object_error_category::default_error_condition(int EV) const {
if (static_cast<object_error>(EV) == object_error::success)
return error_condition();
return errc::invalid_argument;
}