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/tools/llvm-objdump/COFFDump.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/tools/llvm-objdump/COFFDump.cpp')
-rw-r--r-- | llvm/tools/llvm-objdump/COFFDump.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/tools/llvm-objdump/COFFDump.cpp b/llvm/tools/llvm-objdump/COFFDump.cpp index 4a20b91b71f..976a92154bd 100644 --- a/llvm/tools/llvm-objdump/COFFDump.cpp +++ b/llvm/tools/llvm-objdump/COFFDump.cpp @@ -167,7 +167,7 @@ resolveSectionAndAddress(const COFFObjectFile *Obj, const SymbolRef &Sym, if (std::error_code EC = Sym.getSection(iter)) return EC; ResolvedSection = Obj->getCOFFSection(*iter); - return object_error::success; + return std::error_code(); } // Given a vector of relocations for a section and an offset into this section @@ -182,7 +182,7 @@ static std::error_code resolveSymbol(const std::vector<RelocationRef> &Rels, return EC; if (Ofs == Offset) { Sym = *I->getSymbol(); - return object_error::success; + return std::error_code(); } } return object_error::parse_failed; @@ -204,7 +204,7 @@ getSectionContents(const COFFObjectFile *Obj, return EC; if (std::error_code EC = Obj->getSectionContents(Section, Contents)) return EC; - return object_error::success; + return std::error_code(); } // Given a vector of relocations for a section and an offset into this section @@ -217,7 +217,7 @@ static std::error_code resolveSymbolName(const std::vector<RelocationRef> &Rels, return EC; if (std::error_code EC = Sym.getName(Name)) return EC; - return object_error::success; + return std::error_code(); } static void printCOFFSymbolAddress(llvm::raw_ostream &Out, |