[PATCH] D16645: ELF: Report multiple errors from the driver.

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 17:35:18 PST 2016


rafael accepted this revision.
rafael added a comment.
This revision is now accepted and ready to land.

LGTM with two nits.


================
Comment at: ELF/Driver.cpp:68
@@ -65,2 +67,3 @@
   ErrorOr<std::unique_ptr<Archive>> FileOrErr = Archive::create(MB);
-  fatal(FileOrErr, "Failed to parse archive");
+  if (error(FileOrErr, "Failed to parse archive"))
+    return {};
----------------
This is a broken file case, I would leave it for another patch.

================
Comment at: ELF/Driver.cpp:74
@@ -70,6 +73,3 @@
   for (const ErrorOr<Archive::Child> &C : File->children()) {
-    fatal(C, "Could not get the child of the archive " + File->getFileName());
-    ErrorOr<MemoryBufferRef> MbOrErr = C->getMemoryBufferRef();
-    fatal(MbOrErr, "Could not get the buffer for a child of the archive " +
-                       File->getFileName());
-    V.push_back(*MbOrErr);
+    StringRef S = File->getFileName();
+    if (error(C, "Could not get the child of the archive " + S))
----------------
Same here.


http://reviews.llvm.org/D16645





More information about the llvm-commits mailing list