COFF: Remove `void error()` functions and use fatal instead.

This change makes the control flow more explicit.

llvm-svn: 275504
diff --git a/lld/COFF/PDB.cpp b/lld/COFF/PDB.cpp
index 023e03c..7606ccc 100644
--- a/lld/COFF/PDB.cpp
+++ b/lld/COFF/PDB.cpp
@@ -38,7 +38,8 @@
   size_t FileSize = PageSize * 3;
   ErrorOr<std::unique_ptr<FileOutputBuffer>> BufferOrErr =
       FileOutputBuffer::create(Path, FileSize);
-  check(BufferOrErr, "failed to open " + Path);
+  if (auto EC = BufferOrErr.getError())
+    fatal(EC, "failed to open " + Path);
   std::unique_ptr<FileOutputBuffer> Buffer = std::move(*BufferOrErr);
 
   // Write the file header.