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
diff --git a/lib/Frontend/DependencyFile.cpp b/lib/Frontend/DependencyFile.cpp
index bc5a55d..5c3a231 100644
--- a/lib/Frontend/DependencyFile.cpp
+++ b/lib/Frontend/DependencyFile.cpp
@@ -171,7 +171,7 @@
*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) {