r198957 - Use the simpler version of llvm::sys::fs::remove when possible.
Rafael Espindola
rafael.espindola at gmail.com
Fri Jan 10 13:32:14 PST 2014
Author: rafael
Date: Fri Jan 10 15:32:14 2014
New Revision: 198957
URL: http://llvm.org/viewvc/llvm-project?rev=198957&view=rev
Log:
Use the simpler version of llvm::sys::fs::remove when possible.
Modified:
cfe/trunk/lib/ARCMigrate/FileRemapper.cpp
cfe/trunk/lib/Frontend/ASTUnit.cpp
cfe/trunk/lib/Frontend/CompilerInstance.cpp
cfe/trunk/lib/Frontend/DependencyFile.cpp
cfe/trunk/lib/Rewrite/Core/Rewriter.cpp
cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp
Modified: cfe/trunk/lib/ARCMigrate/FileRemapper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/FileRemapper.cpp?rev=198957&r1=198956&r2=198957&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/FileRemapper.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/FileRemapper.cpp Fri Jan 10 15:32:14 2014
@@ -36,8 +36,7 @@ void FileRemapper::clear(StringRef outpu
assert(ToFromMappings.empty());
if (!outputDir.empty()) {
std::string infoFile = getRemapInfoFile(outputDir);
- bool existed;
- llvm::sys::fs::remove(infoFile, existed);
+ llvm::sys::fs::remove(infoFile);
}
}
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=198957&r1=198956&r2=198957&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Fri Jan 10 15:32:14 2014
@@ -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;
}
Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=198957&r1=198956&r2=198957&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Fri Jan 10 15:32:14 2014
@@ -432,8 +432,7 @@ void CompilerInstance::clearOutputFiles(
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(
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 Heade
// 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());
}
}
Modified: cfe/trunk/lib/Frontend/DependencyFile.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/DependencyFile.cpp?rev=198957&r1=198956&r2=198957&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/DependencyFile.cpp (original)
+++ cfe/trunk/lib/Frontend/DependencyFile.cpp Fri Jan 10 15:32:14 2014
@@ -166,8 +166,7 @@ static void PrintFilename(raw_ostream &O
void DependencyFileCallback::OutputDependencyFile() {
if (SeenMissingHeader) {
- bool existed;
- llvm::sys::fs::remove(OutputFile, existed);
+ llvm::sys::fs::remove(OutputFile);
return;
}
Modified: cfe/trunk/lib/Rewrite/Core/Rewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/Core/Rewriter.cpp?rev=198957&r1=198956&r2=198957&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/Core/Rewriter.cpp (original)
+++ cfe/trunk/lib/Rewrite/Core/Rewriter.cpp Fri Jan 10 15:32:14 2014
@@ -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());
}
}
Modified: cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp?rev=198957&r1=198956&r2=198957&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp (original)
+++ cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp Fri Jan 10 15:32:14 2014
@@ -807,13 +807,12 @@ GlobalModuleIndex::writeIndex(FileManage
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;
}
More information about the cfe-commits
mailing list