summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commit582b2ab0dd9a81d4f91ff096320c2b46750f4b3a (patch)
tree8e5636693c9e8faec48c73369727af361b87727d /clang/lib
parent430fa9bfb3aa13cd77b970c8994dfedd5fc38af5 (diff)
downloadbcm5719-llvm-582b2ab0dd9a81d4f91ff096320c2b46750f4b3a.tar.gz
bcm5719-llvm-582b2ab0dd9a81d4f91ff096320c2b46750f4b3a.zip
[Driver] Don't remove non-regular files that were outputs.
llvm-svn: 173215
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Driver/Compilation.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp
index f550a2746e4..9c7100fb80c 100644
--- a/clang/lib/Driver/Compilation.cpp
+++ b/clang/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)) {
OpenPOWER on IntegriCloud