diff options
author | Rui Ueyama <ruiu@google.com> | 2015-06-09 15:20:42 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2015-06-09 15:20:42 +0000 |
commit | 7d0991953499174797b0ff94167bfec33e67ccfb (patch) | |
tree | d8d85786e47ed032c55ac2271a2e453fc3ae69c6 /llvm/lib/Object/MachOUniversal.cpp | |
parent | 703e8486ecaff3c059eaa262e04699bd1d9e2c8b (diff) | |
download | bcm5719-llvm-7d0991953499174797b0ff94167bfec33e67ccfb.tar.gz bcm5719-llvm-7d0991953499174797b0ff94167bfec33e67ccfb.zip |
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/MachOUniversal.cpp')
-rw-r--r-- | llvm/lib/Object/MachOUniversal.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Object/MachOUniversal.cpp b/llvm/lib/Object/MachOUniversal.cpp index a01c83873e0..2705e7dc40e 100644 --- a/llvm/lib/Object/MachOUniversal.cpp +++ b/llvm/lib/Object/MachOUniversal.cpp @@ -120,7 +120,7 @@ MachOUniversalBinary::MachOUniversalBinary(MemoryBufferRef Source, ec = object_error::parse_failed; return; } - ec = object_error::success; + ec = std::error_code(); } static bool getCTMForArch(Triple::ArchType Arch, MachO::CPUType &CTM) { |