diff options
author | Lang Hames <lhames@gmail.com> | 2016-07-14 00:37:04 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2016-07-14 00:37:04 +0000 |
commit | 5daf897d80fedff6c8c1b5f7a133fdf5d7b6d606 (patch) | |
tree | 785b039365a074a5581df40ea8fec377ebecfa8b /tools/llvm-cxxdump | |
parent | 3dc0c3e82b5f3deffe787374aa7c35e514e59fee (diff) |
[Object] Revert r275316, Archive::child_iterator changes, while I update lld.
Should fix the bots broken by r275316.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-cxxdump')
-rw-r--r-- | tools/llvm-cxxdump/llvm-cxxdump.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/tools/llvm-cxxdump/llvm-cxxdump.cpp b/tools/llvm-cxxdump/llvm-cxxdump.cpp index c92d20d6ccf..0c408ccb5ba 100644 --- a/tools/llvm-cxxdump/llvm-cxxdump.cpp +++ b/tools/llvm-cxxdump/llvm-cxxdump.cpp @@ -50,14 +50,6 @@ static void error(std::error_code EC) { exit(1); } -static void error(Error Err) { - if (Err) { - logAllUnhandledErrors(std::move(Err), outs(), "Error reading file: "); - outs().flush(); - exit(1); - } -} - } // namespace llvm static void reportError(StringRef Input, StringRef Message) { @@ -490,8 +482,9 @@ static void dumpCXXData(const ObjectFile *Obj) { } static void dumpArchive(const Archive *Arc) { - Error Err; - for (auto &ArcC : Arc->children(Err)) { + for (auto &ErrorOrChild : Arc->children()) { + error(ErrorOrChild.getError()); + const Archive::Child &ArcC = *ErrorOrChild; Expected<std::unique_ptr<Binary>> ChildOrErr = ArcC.getAsBinary(); if (!ChildOrErr) { // Ignore non-object files. @@ -511,7 +504,6 @@ static void dumpArchive(const Archive *Arc) { else reportError(Arc->getFileName(), cxxdump_error::unrecognized_file_format); } - error(std::move(Err)); } static void dumpInput(StringRef File) { |