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<...> .

llvm-svn: 265607
This commit is contained in:
Kevin Enderby 2016-04-06 22:15:23 +00:00
parent 3fcdf6ae2a
commit 439453679c
1 changed files with 3 additions and 1 deletions

View 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())) {