Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix emission of phony dependency targets when adding extra deps
Summary: This commit fixes a bug where passing extra dependency entries (using -fdepfile-entry) would result in -MP incorrectly emitting a phony target for the input file, and no phony target for the first extra dependency. The extra dependencies are added first to the filename vector in DFGImpl. That clashed with the emission of the phony targets, as the code assumed that the first index always correspond to the input file. Reviewers: rsmith, pcc, krasin, bruno, vsapsai Reviewed By: vsapsai Subscribers: vsapsai, bruno, cfe-commits Differential Revision: https://reviews.llvm.org/D44568 llvm-svn: 333413
- Loading branch information
Showing
2 changed files
with
25 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: %clang -MM -MP -Xclang -fdepfile-entry=1.extra -Xclang -fdepfile-entry=2.extra -Xclang -fdepfile-entry=2.extra %s | \ | ||
// RUN: FileCheck %s --implicit-check-not=.c: | ||
// | ||
// Verify that phony targets are only created for the extra dependency files, | ||
// and not the input file. | ||
|
||
// CHECK: dependency-gen-extradeps-phony.o: 1.extra 2.extra \ | ||
// CHECK-NEXT: dependency-gen-extradeps-phony.c | ||
// CHECK: 1.extra: | ||
// CHECK: 2.extra: |