Re-submit ELF: Report multiple errors from the driver.
This reverts r259395 which reverted r259143.
llvm-svn: 259572
diff --git a/lld/ELF/Error.cpp b/lld/ELF/Error.cpp
index 327bb26..e3add1b 100644
--- a/lld/ELF/Error.cpp
+++ b/lld/ELF/Error.cpp
@@ -24,14 +24,18 @@
HasError = true;
}
-void error(std::error_code EC, const Twine &Prefix) {
- if (EC)
- error(Prefix + ": " + EC.message());
+bool error(std::error_code EC, const Twine &Prefix) {
+ if (!EC)
+ return false;
+ error(Prefix + ": " + EC.message());
+ return true;
}
-void error(std::error_code EC) {
- if (EC)
- error(EC.message());
+bool error(std::error_code EC) {
+ if (!EC)
+ return false;
+ error(EC.message());
+ return true;
}
void fatal(const Twine &Msg) {