aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-09-21 23:13:36 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-09-21 23:13:36 +0000
commit25cbdf25a667999485d79735f1a9ea61faf79eee (patch)
tree1bd920b92779d9706db8679815f730863eb83f11 /llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
parent3306fff625738ce2946770f411dd8341d9a182d6 (diff)
downloadllvm-25cbdf25a667999485d79735f1a9ea61faf79eee.zip
llvm-25cbdf25a667999485d79735f1a9ea61faf79eee.tar.gz
llvm-25cbdf25a667999485d79735f1a9ea61faf79eee.tar.bz2
Convert the archive writer to use Error.
This found one place in lld that was not checking the error. llvm-svn: 313937
Diffstat (limited to 'llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp')
-rw-r--r--llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
index a7268d0..f5cf848 100644
--- a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
+++ b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
@@ -157,13 +157,13 @@ int llvm::libDriverMain(ArrayRef<const char *> ArgsArr) {
// Create an archive file.
std::string OutputPath = getOutputPath(&Args, Members[0]);
- std::error_code EC =
- writeArchive(OutputPath, Members,
- /*WriteSymtab=*/true, object::Archive::K_GNU,
- /*Deterministic*/ true, Args.hasArg(OPT_llvmlibthin));
-
- if (EC) {
- llvm::errs() << OutputPath << ": " << EC.message() << "\n";
+ if (Error E =
+ writeArchive(OutputPath, Members,
+ /*WriteSymtab=*/true, object::Archive::K_GNU,
+ /*Deterministic*/ true, Args.hasArg(OPT_llvmlibthin))) {
+ handleAllErrors(std::move(E), [&](const ErrorInfoBase &EI) {
+ llvm::errs() << OutputPath << ": " << EI.message() << "\n";
+ });
return 1;
}