Make the Error class constructor protected
This is forcing to use Error::success(), which is in a wide majority
of cases a lot more readable.
Differential Revision: https://reviews.llvm.org/D26481
llvm-svn: 286561
diff --git a/lldb/source/Host/windows/PipeWindows.cpp b/lldb/source/Host/windows/PipeWindows.cpp
index 407f046..64b6584 100644
--- a/lldb/source/Host/windows/PipeWindows.cpp
+++ b/lldb/source/Host/windows/PipeWindows.cpp
@@ -161,7 +161,7 @@
ZeroMemory(&m_write_overlapped, sizeof(m_write_overlapped));
}
- return Error();
+ return Error::success();
}
int PipeWindows::GetReadFileDescriptor() const { return m_read_fd; }
@@ -217,7 +217,7 @@
CloseWriteFileDescriptor();
}
-Error PipeWindows::Delete(llvm::StringRef name) { return Error(); }
+Error PipeWindows::Delete(llvm::StringRef name) { return Error::success(); }
bool PipeWindows::CanRead() const { return (m_read != INVALID_HANDLE_VALUE); }
@@ -273,7 +273,7 @@
return Error(::GetLastError(), eErrorTypeWin32);
bytes_read = sys_bytes_read;
- return Error();
+ return Error::success();
}
Error PipeWindows::Write(const void *buf, size_t num_bytes,
@@ -291,5 +291,5 @@
&sys_bytes_written, TRUE);
if (!result)
return Error(::GetLastError(), eErrorTypeWin32);
- return Error();
+ return Error::success();
}