[llvm-objdump] Use report_error() and improve error coverage.
[oota-llvm.git] / tools / llvm-objdump / MachODump.cpp
index e486b1a0d6d9eb9d7072b40ed46d4198f6c2a771..87b2b439d55cc6136530e8fa3e714e1e386f297a 100644 (file)
@@ -1481,10 +1481,8 @@ void llvm::ParseInputMachO(StringRef Filename) {
 
   // Attempt to open the binary.
   ErrorOr<OwningBinary<Binary>> BinaryOrErr = createBinary(Filename);
-  if (std::error_code EC = BinaryOrErr.getError()) {
-    errs() << "llvm-objdump: '" << Filename << "': " << EC.message() << ".\n";
-    return;
-  }
+  if (std::error_code EC = BinaryOrErr.getError())
+    report_error(Filename, EC);
   Binary &Bin = *BinaryOrErr.get().getBinary();
 
   if (Archive *A = dyn_cast<Archive>(&Bin)) {