aboutsummaryrefslogtreecommitdiff
path: root/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
commitccad3db9b95012e260c71ded41c6141619202b09 (patch)
treeb5116a5de8e7cb77d56e846bd8b91d7e2a63b085 /lib/Frontend/DependencyFile.cpp
parent484fc57c8d2d3ba645a03f9e294dcebc5aacaf44 (diff)
Fixes a crash when generating dependency file stuff
and output file is not writable. // rdar://9286457. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129587 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/DependencyFile.cpp')
-rw-r--r--lib/Frontend/DependencyFile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Frontend/DependencyFile.cpp b/lib/Frontend/DependencyFile.cpp
index bc5a55df08..5c3a23128a 100644
--- a/lib/Frontend/DependencyFile.cpp
+++ b/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) {