summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/DependencyFile.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-04-15 18:49:23 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-04-15 18:49:23 +0000
commit193f783a999426c65a1d4fb407d8095f248c155d (patch)
treeb526ab4135f7015795c806629e266fbd959329fd /clang/lib/Frontend/DependencyFile.cpp
parentcc647e093788314b870c7a528ae0c5d8f7c04a51 (diff)
downloadbcm5719-llvm-193f783a999426c65a1d4fb407d8095f248c155d.tar.gz
bcm5719-llvm-193f783a999426c65a1d4fb407d8095f248c155d.zip
Fixes a crash when generating dependency file stuff
and output file is not writable. // rdar://9286457. llvm-svn: 129587
Diffstat (limited to 'clang/lib/Frontend/DependencyFile.cpp')
-rw-r--r--clang/lib/Frontend/DependencyFile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/DependencyFile.cpp b/clang/lib/Frontend/DependencyFile.cpp
index bc5a55df086..5c3a23128a1 100644
--- a/clang/lib/Frontend/DependencyFile.cpp
+++ b/clang/lib/Frontend/DependencyFile.cpp
@@ -171,7 +171,7 @@ void DependencyFileCallback::OutputDependencyFile() {
*OS << '\n';
// Create phony targets if requested.
- if (PhonyTarget) {
+ if (PhonyTarget && !Files.empty()) {
// Skip the first entry, this is always the input file itself.
for (std::vector<std::string>::iterator I = Files.begin() + 1,
E = Files.end(); I != E; ++I) {
OpenPOWER on IntegriCloud