diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-18 20:58:25 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-18 20:58:25 +0000 |
commit | fc92e8458636a98a4231d39fe803a9ea886764be (patch) | |
tree | a9131b50eb046818f9d5e84d67425222c4760b75 | |
parent | a1280c16fb012fb167787a7c99d526bc19153dcc (diff) | |
download | bcm5719-llvm-fc92e8458636a98a4231d39fe803a9ea886764be.tar.gz bcm5719-llvm-fc92e8458636a98a4231d39fe803a9ea886764be.zip |
Use llvm::sys::fs::can_write.
llvm-svn: 184234
-rw-r--r-- | clang/lib/Driver/Compilation.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp index ef40ae4afbb..32d687e5ca8 100644 --- a/clang/lib/Driver/Compilation.cpp +++ b/clang/lib/Driver/Compilation.cpp @@ -16,6 +16,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/Option/ArgList.h" +#include "llvm/Support/FileSystem.h" #include "llvm/Support/PathV1.h" #include "llvm/Support/Program.h" #include "llvm/Support/raw_ostream.h" @@ -208,7 +209,7 @@ bool Compilation::CleanupFile(const char *File, bool IssueErrors) const { // Don't try to remove files which we don't have write access to (but may be // able to remove), or non-regular files. Underlying tools may have // intentionally not overwritten them. - if (!P.canWrite() || !P.isRegularFile()) + if (!llvm::sys::fs::can_write(File) || !P.isRegularFile()) return true; if (P.eraseFromDisk(false, &Error)) { diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 66c79d0e9e4..a2872dd4f20 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -535,7 +535,8 @@ CompilerInstance::createOutputFile(StringRef OutputPath, 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; |