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