summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp')
-rw-r--r--llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp b/llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp
index c92d20d6ccf..0c408ccb5ba 100644
--- a/llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp
+++ b/llvm/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) {
OpenPOWER on IntegriCloud