aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp')
-rw-r--r--llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
index afda6a1..912a093 100644
--- a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
+++ b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
@@ -153,15 +153,14 @@ int llvm::libDriverMain(llvm::ArrayRef<const char*> ArgsArr) {
Members.emplace_back(std::move(*MOrErr));
}
- std::pair<StringRef, std::error_code> Result =
- llvm::writeArchive(getOutputPath(&Args, Members[0]), Members,
+ std::string OutputPath = getOutputPath(&Args, Members[0]);
+ std::error_code EC =
+ llvm::writeArchive(OutputPath, Members,
/*WriteSymtab=*/true, object::Archive::K_GNU,
/*Deterministic*/ true, Args.hasArg(OPT_llvmlibthin));
- if (Result.second) {
- if (Result.first.empty())
- Result.first = ArgsArr[0];
- llvm::errs() << Result.first << ": " << Result.second.message() << "\n";
+ if (EC) {
+ llvm::errs() << OutputPath << ": " << EC.message() << "\n";
return 1;
}