Use llvm::sys::fs::can_write.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184234 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index 66c79d0..a2872dd 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/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;