[llvm-objdump] - Remove one of `report_error` functions and improve the error reporting.

One of the report_error functions was taking object::Archive::Child as an
argument. It feels excessive, this patch removes it and introduce a helper
function instead. Also I fixed a "TODO" in this patch what improved the message printed.

Differential revision: https://reviews.llvm.org/D66468

llvm-svn: 369382
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.h b/llvm/tools/llvm-objdump/llvm-objdump.h
index eaa48b8..4d512d2 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.h
+++ b/llvm/tools/llvm-objdump/llvm-objdump.h
@@ -136,9 +136,6 @@
 LLVM_ATTRIBUTE_NORETURN void
 report_error(Error E, StringRef FileName, StringRef ArchiveName,
              StringRef ArchitectureName = StringRef());
-LLVM_ATTRIBUTE_NORETURN void
-report_error(Error E, StringRef ArchiveName, const object::Archive::Child &C,
-             StringRef ArchitectureName = StringRef());
 
 template <typename T, typename... Ts>
 T unwrapOrError(Expected<T> EO, Ts &&... Args) {
@@ -147,6 +144,9 @@
   report_error(EO.takeError(), std::forward<Ts>(Args)...);
 }
 
+std::string getFileNameForError(const object::Archive::Child &C,
+                                unsigned Index);
+
 } // end namespace llvm
 
 #endif