https://llvm.org/bugs/show_bug.cgi?id=31644
Bug ID: 31644 Summary: r287138 causes -MP output to be incorrect Product: new-bugs Version: trunk Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: new bugs Assignee: unassignedb...@nondot.org Reporter: dimi...@andric.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Before r287138: $ cat a.c int main(void) { return 0; } $ clang -MD -MP -c a.c $ cat a.d a.o: a.c After r287138: $ clang -MD -MP -c a.c $ cat a.d a.o: a.c a.c: E.g. one additional dependency for the main source file itself is printed, while it should not be. The relevant piece of code is in DFGImpl::OutputDependencyFile(): // Create phony targets if requested. if (PhonyTarget && !Files.empty()) { // Skip the first entry, this is always the input file itself. for (StringRef File : Files) { OS << '\n'; PrintFilename(OS, File, OutputFormat); OS << ":\n"; } } Unfortunately the comment does not match the range-based for loop anymore, as this does *not* skip the first entry. The code used to do: for (std::vector<std::string>::iterator I = Files.begin() + 1, E = Files.end(); I != E; ++I) { I am unsure how to achieve this effect with range-based for loops though, it may be best to just revert that part. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs