Needed change to lld for the change to createBinary() now returning Expected<...>
authorKevin Enderby <enderby@apple.com>
Wed, 6 Apr 2016 22:15:23 +0000 (22:15 +0000)
committerKevin Enderby <enderby@apple.com>
Wed, 6 Apr 2016 22:15:23 +0000 (22:15 +0000)
With the llvm change in r265606 this is the matching needed change to the lld
code now that createBinary() is returning Expected<...> .

llvm-svn: 265607

lld/COFF/InputFiles.cpp

index 8ff6b9c..088092e 100644 (file)
@@ -93,7 +93,9 @@ MemoryBufferRef ArchiveFile::getMember(const Archive::Symbol *Sym) {
 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())) {