Fix for PR5568.

llvm-svn: 89766
This commit is contained in:
Edward O'Callaghan 2009-11-24 15:23:21 +00:00
parent dddf134a3c
commit db521ec23b
1 changed files with 7 additions and 0 deletions

View File

@ -85,9 +85,16 @@ bool Compilation::CleanupFileList(const ArgStringList &Files,
for (ArgStringList::const_iterator
it = Files.begin(), ie = Files.end(); it != ie; ++it) {
llvm::sys::Path P(*it);
std::string Error;
if (P.isSpecialFile()) {
// If we have a special file in our list, i.e. /dev/null
// then don't call eraseFromDisk() and just continue.
continue;
}
if (P.eraseFromDisk(false, &Error)) {
// Failure is only failure if the file doesn't exist. There is a
// race condition here due to the limited interface of