summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump/MachODump.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-08-03 18:44:32 +0000
committerVedant Kumar <vsk@apple.com>2016-08-03 18:44:32 +0000
commitbfb6072d84fbd6169d57afe9d812de1abca7b5d7 (patch)
treeca63aef2231c865815c8d3af447996f6e9c34b96 /llvm/tools/llvm-objdump/MachODump.cpp
parent23ee12e173762f977f1deeec14dccb32f6478204 (diff)
downloadbcm5719-llvm-bfb6072d84fbd6169d57afe9d812de1abca7b5d7.tar.gz
bcm5719-llvm-bfb6072d84fbd6169d57afe9d812de1abca7b5d7.zip
Revert "More fixes to get good error messages for bad archives."
This reverts commit r277540. It breaks the build with: ../lib/Object/Archive.cpp:264:41: error: return type of out-of-line definition of 'llvm::object::ArchiveMemberHeader::getUID' differs from that in the declaration Expected<unsigned> ArchiveMemberHeader::getUID() const { ~~~~~~~~~~~~~~~~~~ ^ include/llvm/Object/Archive.h:53:12: note: previous declaration is here unsigned getUID() const; ~~~~~~~~ ^ llvm-svn: 277627
Diffstat (limited to 'llvm/tools/llvm-objdump/MachODump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/MachODump.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp
index b5e7a067b7c..8d924e568b7 100644
--- a/llvm/tools/llvm-objdump/MachODump.cpp
+++ b/llvm/tools/llvm-objdump/MachODump.cpp
@@ -1477,10 +1477,7 @@ static void printArchiveChild(StringRef Filename, const Archive::Child &C,
StringRef ArchitectureName = StringRef()) {
if (print_offset)
outs() << C.getChildOffset() << "\t";
- Expected<sys::fs::perms> ModeOrErr = C.getAccessMode();
- if (!ModeOrErr)
- report_error(Filename, C, ModeOrErr.takeError(), ArchitectureName);
- sys::fs::perms Mode = ModeOrErr.get();
+ sys::fs::perms Mode = C.getAccessMode();
if (verbose) {
// FIXME: this first dash, "-", is for (Mode & S_IFMT) == S_IFREG.
// But there is nothing in sys::fs::perms for S_IFMT or S_IFREG.
@@ -1498,15 +1495,9 @@ static void printArchiveChild(StringRef Filename, const Archive::Child &C,
outs() << format("0%o ", Mode);
}
- Expected<unsigned> UIDOrErr = C.getUID();
- if (!UIDOrErr)
- report_error(Filename, C, UIDOrErr.takeError(), ArchitectureName);
- unsigned UID = UIDOrErr.get();
+ unsigned UID = C.getUID();
outs() << format("%3d/", UID);
- Expected<unsigned> GIDOrErr = C.getGID();
- if (!GIDOrErr)
- report_error(Filename, C, GIDOrErr.takeError(), ArchitectureName);
- unsigned GID = GIDOrErr.get();
+ unsigned GID = C.getGID();
outs() << format("%-3d ", GID);
Expected<uint64_t> Size = C.getRawSize();
if (!Size)
@@ -1517,8 +1508,7 @@ static void printArchiveChild(StringRef Filename, const Archive::Child &C,
if (verbose) {
unsigned Seconds;
if (RawLastModified.getAsInteger(10, Seconds))
- outs() << "(date: \"" << RawLastModified
- << "\" contains non-decimal chars) ";
+ outs() << "(date: \"%s\" contains non-decimal chars) " << RawLastModified;
else {
// Since cime(3) returns a 26 character string of the form:
// "Sun Sep 16 01:03:52 1973\n\0"
OpenPOWER on IntegriCloud