aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Compilation.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2013-01-23 01:08:23 +0000
committerDaniel Dunbar <daniel@zuster.org>2013-01-23 01:08:23 +0000
commit6ea3a2a6fafde4732ca4dd0426141772a5904271 (patch)
treeab41d4e3521b6c94e4701da22d6090922362fa6f /lib/Driver/Compilation.cpp
parent18f43a62134eca1cd830a5b289f4bee4e6ee42fe (diff)
[Driver] Don't remove non-regular files that were outputs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173215 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Compilation.cpp')
-rw-r--r--lib/Driver/Compilation.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Driver/Compilation.cpp b/lib/Driver/Compilation.cpp
index f550a2746e..9c7100fb80 100644
--- a/lib/Driver/Compilation.cpp
+++ b/lib/Driver/Compilation.cpp
@@ -210,9 +210,9 @@ bool Compilation::CleanupFileList(const ArgStringList &Files,
std::string Error;
// Don't try to remove files which we don't have write access to (but may be
- // able to remove). Underlying tools may have intentionally not overwritten
- // them.
- if (!P.canWrite())
+ // able to remove), or non-regular files. Underlying tools may have
+ // intentionally not overwritten them.
+ if (!P.canWrite() || !P.isRegularFile())
continue;
if (P.eraseFromDisk(false, &Error)) {