[lld] r265607 - Needed change to lld for the change to createBinary() now returning Expected<...>

Kevin Enderby via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 15:15:24 PDT 2016


Author: enderby
Date: Wed Apr  6 17:15:23 2016
New Revision: 265607

URL: http://llvm.org/viewvc/llvm-project?rev=265607&view=rev
Log:
Needed change to lld for the change to createBinary() now returning Expected<...>

With the llvm change in r265606 this is the matching needed change to the lld
code now that createBinary() is returning Expected<...> .

Modified:
    lld/trunk/COFF/InputFiles.cpp

Modified: lld/trunk/COFF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.cpp?rev=265607&r1=265606&r2=265607&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.cpp (original)
+++ lld/trunk/COFF/InputFiles.cpp Wed Apr  6 17:15:23 2016
@@ -93,7 +93,9 @@ MemoryBufferRef ArchiveFile::getMember(c
 void ObjectFile::parse() {
   // Parse a memory buffer as a COFF file.
   auto BinOrErr = createBinary(MB);
-  error(BinOrErr, "Failed to parse object file");
+  if (!BinOrErr)
+    error(errorToErrorCode(BinOrErr.takeError()),
+                           "Failed to parse object file");
   std::unique_ptr<Binary> Bin = std::move(*BinOrErr);
 
   if (auto *Obj = dyn_cast<COFFObjectFile>(Bin.get())) {




More information about the llvm-commits mailing list