diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-10 21:32:14 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-10 21:32:14 +0000 |
| commit | 2a008784d36f492b1fbead7a0f2e7c838ea0befb (patch) | |
| tree | 28f7976720b717f7e64cf4f37389f1fbfd0a2a13 /clang/lib | |
| parent | c0a5d5bc4f7edab93b98204abebd59126af494b5 (diff) | |
| download | bcm5719-llvm-2a008784d36f492b1fbead7a0f2e7c838ea0befb.tar.gz bcm5719-llvm-2a008784d36f492b1fbead7a0f2e7c838ea0befb.zip | |
Use the simpler version of llvm::sys::fs::remove when possible.
llvm-svn: 198957
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/ARCMigrate/FileRemapper.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 12 | ||||
| -rw-r--r-- | clang/lib/Frontend/DependencyFile.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/Rewrite/Core/Rewriter.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/Serialization/GlobalModuleIndex.cpp | 5 |
6 files changed, 10 insertions, 19 deletions
diff --git a/clang/lib/ARCMigrate/FileRemapper.cpp b/clang/lib/ARCMigrate/FileRemapper.cpp index a14226e43fe..e406d47c025 100644 --- a/clang/lib/ARCMigrate/FileRemapper.cpp +++ b/clang/lib/ARCMigrate/FileRemapper.cpp @@ -36,8 +36,7 @@ void FileRemapper::clear(StringRef outputDir) { assert(ToFromMappings.empty()); if (!outputDir.empty()) { std::string infoFile = getRemapInfoFile(outputDir); - bool existed; - llvm::sys::fs::remove(infoFile, existed); + llvm::sys::fs::remove(infoFile); } } diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 4f761f4c9bc..983045565f9 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -2591,8 +2591,7 @@ bool ASTUnit::Save(StringRef File) { } if (llvm::sys::fs::rename(TempPath.str(), File)) { - bool exists; - llvm::sys::fs::remove(TempPath.str(), exists); + llvm::sys::fs::remove(TempPath.str()); return true; } diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 48ba0056071..e311465cba1 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -432,8 +432,7 @@ void CompilerInstance::clearOutputFiles(bool EraseFiles) { delete it->OS; if (!it->TempFilename.empty()) { if (EraseFiles) { - bool existed; - llvm::sys::fs::remove(it->TempFilename, existed); + llvm::sys::fs::remove(it->TempFilename); } else { SmallString<128> NewOutFile(it->Filename); @@ -445,8 +444,7 @@ void CompilerInstance::clearOutputFiles(bool EraseFiles) { getDiagnostics().Report(diag::err_unable_to_rename_temp) << it->TempFilename << it->Filename << ec.message(); - bool existed; - llvm::sys::fs::remove(it->TempFilename, existed); + llvm::sys::fs::remove(it->TempFilename); } } } else if (!it->Filename.empty() && EraseFiles) @@ -1091,10 +1089,8 @@ static void pruneModuleCache(const HeaderSearchOptions &HSOpts) { // If we removed all of the files in the directory, remove the directory // itself. - if (RemovedAllFiles) { - bool Existed; - llvm::sys::fs::remove(Dir->path(), Existed); - } + if (RemovedAllFiles) + llvm::sys::fs::remove(Dir->path()); } } diff --git a/clang/lib/Frontend/DependencyFile.cpp b/clang/lib/Frontend/DependencyFile.cpp index 4037af9055d..1e3aba7254c 100644 --- a/clang/lib/Frontend/DependencyFile.cpp +++ b/clang/lib/Frontend/DependencyFile.cpp @@ -166,8 +166,7 @@ static void PrintFilename(raw_ostream &OS, StringRef Filename) { void DependencyFileCallback::OutputDependencyFile() { if (SeenMissingHeader) { - bool existed; - llvm::sys::fs::remove(OutputFile, existed); + llvm::sys::fs::remove(OutputFile); return; } diff --git a/clang/lib/Rewrite/Core/Rewriter.cpp b/clang/lib/Rewrite/Core/Rewriter.cpp index 51af83954c5..9bcb264597c 100644 --- a/clang/lib/Rewrite/Core/Rewriter.cpp +++ b/clang/lib/Rewrite/Core/Rewriter.cpp @@ -458,10 +458,9 @@ public: AllWritten = false; Diagnostics.Report(clang::diag::err_unable_to_rename_temp) << TempFilename << Filename << ec.message(); - bool existed; // If the remove fails, there's not a lot we can do - this is already an // error. - llvm::sys::fs::remove(TempFilename.str(), existed); + llvm::sys::fs::remove(TempFilename.str()); } } diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp index fb647b0be9b..fcdf5f5a8d9 100644 --- a/clang/lib/Serialization/GlobalModuleIndex.cpp +++ b/clang/lib/Serialization/GlobalModuleIndex.cpp @@ -807,13 +807,12 @@ GlobalModuleIndex::writeIndex(FileManager &FileMgr, StringRef Path) { return EC_IOError; // Remove the old index file. It isn't relevant any more. - bool OldIndexExisted; - llvm::sys::fs::remove(IndexPath.str(), OldIndexExisted); + llvm::sys::fs::remove(IndexPath.str()); // Rename the newly-written index file to the proper name. if (llvm::sys::fs::rename(IndexTmpPath.str(), IndexPath.str())) { // Rename failed; just remove the - llvm::sys::fs::remove(IndexTmpPath.str(), OldIndexExisted); + llvm::sys::fs::remove(IndexTmpPath.str()); return EC_IOError; } |

