From 7d0991953499174797b0ff94167bfec33e67ccfb Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 9 Jun 2015 15:20:42 +0000 Subject: 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 --- llvm/lib/Object/IRObjectFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Object/IRObjectFile.cpp') diff --git a/llvm/lib/Object/IRObjectFile.cpp b/llvm/lib/Object/IRObjectFile.cpp index c12c5d43..e89cb8e 100644 --- a/llvm/lib/Object/IRObjectFile.cpp +++ b/llvm/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 { -- cgit v1.1