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
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index 1460fb0..1152a15 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -400,7 +400,7 @@
   }
   if (Result.empty())
     Result.append(res.begin(), res.end());
-  return object_error::success;
+  return std::error_code();
 }
 
 static std::error_code getRelocationValueString(const ELFObjectFileBase *Obj,
@@ -425,7 +425,7 @@
   if (std::error_code EC = SymI->getName(SymName))
     return EC;
   Result.append(SymName.begin(), SymName.end());
-  return object_error::success;
+  return std::error_code();
 }
 
 static void printRelocationTargetName(const MachOObjectFile *O,
@@ -569,7 +569,7 @@
     // Generic relocation types...
     switch (Type) {
     case MachO::GENERIC_RELOC_PAIR: // prints no info
-      return object_error::success;
+      return std::error_code();
     case MachO::GENERIC_RELOC_SECTDIFF: {
       DataRefImpl RelNext = Rel;
       Obj->moveRelocationNext(RelNext);
@@ -667,7 +667,7 @@
 
   fmt.flush();
   Result.append(fmtbuf.begin(), fmtbuf.end());
-  return object_error::success;
+  return std::error_code();
 }
 
 static std::error_code getRelocationValueString(const RelocationRef &Rel,