Use llvm::sys::fs::can_write.

llvm-svn: 184234
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 66c79d0..a2872dd 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -535,7 +535,8 @@
     bool Exists;
     if ((CreateMissingDirectories || ParentExists) &&
         ((llvm::sys::fs::exists(AbsPath.str(), Exists) || !Exists) ||
-         (OutPath.isRegularFile() && OutPath.canWrite()))) {
+         (OutPath.isRegularFile() &&
+          llvm::sys::fs::can_write(AbsPath.c_str())))) {
       // Create a temporary file.
       SmallString<128> TempPath;
       TempPath = OutFile;