Update for llvm api change.
llvm-svn: 244849
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 6c38c80..2f43510 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -255,9 +255,10 @@
}
template <class ELFT> void Writer<ELFT>::openFile(StringRef Path) {
- std::error_code EC = FileOutputBuffer::create(Path, FileSize, Buffer,
- FileOutputBuffer::F_executable);
- error(EC, Twine("failed to open ") + Path);
+ ErrorOr<std::unique_ptr<FileOutputBuffer>> BufferOrErr =
+ FileOutputBuffer::create(Path, FileSize, FileOutputBuffer::F_executable);
+ error(BufferOrErr, Twine("failed to open ") + Path);
+ Buffer = std::move(*BufferOrErr);
}
// Write section contents to a mmap'ed file.