Fixes a crash when generating dependency file stuff

and output file is not writable. // rdar://9286457.

llvm-svn: 129587
This commit is contained in:
Fariborz Jahanian
2011-04-15 18:49:23 +00:00
parent cc647e0937
commit 193f783a99
2 changed files with 5 additions and 1 deletions

View File

@@ -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) {