aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/Error.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-06-09 15:20:42 +0000
committerRui Ueyama <ruiu@google.com>2015-06-09 15:20:42 +0000
commit7d0991953499174797b0ff94167bfec33e67ccfb (patch)
treed8d85786e47ed032c55ac2271a2e453fc3ae69c6 /llvm/lib/Object/Error.cpp
parent703e8486ecaff3c059eaa262e04699bd1d9e2c8b (diff)
downloadllvm-7d0991953499174797b0ff94167bfec33e67ccfb.zip
llvm-7d0991953499174797b0ff94167bfec33e67ccfb.tar.gz
llvm-7d0991953499174797b0ff94167bfec33e67ccfb.tar.bz2
Remove object_error::success and use std::error_code() instead
make_error_code(object_error) is slow because object::object_category() uses a ManagedStatic variable. But the real problem is that the function is called too frequently. This patch uses std::error_code() instead of object_error::success. In most cases, we return "success", so this patch reduces number of function calls to that function. http://reviews.llvm.org/D10333 llvm-svn: 239409
Diffstat (limited to 'llvm/lib/Object/Error.cpp')
-rw-r--r--llvm/lib/Object/Error.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/llvm/lib/Object/Error.cpp b/llvm/lib/Object/Error.cpp
index 5e4e237..644a178 100644
--- a/llvm/lib/Object/Error.cpp
+++ b/llvm/lib/Object/Error.cpp
@@ -33,7 +33,6 @@ const char *_object_error_category::name() const LLVM_NOEXCEPT {
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:
return "No object file for requested architecture";
case object_error::invalid_file_type: