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 | eae4673c2f43c41b2c227ae011a68b6e2030da10 (patch) | |
tree | 855873b31391b3d8057353e16f3227ff14d3acd2 /lib/Object/IRObjectFile.cpp | |
parent | c1548878562fb029f69bb673e8f56577d9ff6043 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239409 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object/IRObjectFile.cpp')
-rw-r--r-- | lib/Object/IRObjectFile.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Object/IRObjectFile.cpp b/lib/Object/IRObjectFile.cpp index c12c5d4392d..e89cb8ead36 100644 --- a/lib/Object/IRObjectFile.cpp +++ b/lib/Object/IRObjectFile.cpp @@ -195,7 +195,7 @@ std::error_code IRObjectFile::printSymbolName(raw_ostream &OS, unsigned Index = getAsmSymIndex(Symb); assert(Index <= AsmSymbols.size()); OS << AsmSymbols[Index].first; - return object_error::success;; + return std::error_code(); } if (Mang) @@ -203,7 +203,7 @@ std::error_code IRObjectFile::printSymbolName(raw_ostream &OS, else OS << GV->getName(); - return object_error::success; + return std::error_code(); } uint32_t IRObjectFile::getSymbolFlags(DataRefImpl Symb) const { |