Track skipped files in dependency scanning.
authorVolodymyr Sapsai <vsapsai@apple.com>
Tue, 1 May 2018 23:59:33 +0000 (23:59 +0000)
committerVolodymyr Sapsai <vsapsai@apple.com>
Tue, 1 May 2018 23:59:33 +0000 (23:59 +0000)
commit210f0e880b2ecd0b9252c120839ac6ea115f2ce5
treed364c34899198e254a8bbb3be32e3441940354ae
parentddbd2b530c42d46eff1ad1360eb6cc5664f52bb3
Track skipped files in dependency scanning.

It's possible for a header to be a symlink to another header. In this
case both will be represented by clang::FileEntry with the same UID and
they'll use the same clang::HeaderFileInfo.

If you include both headers and use some single-inclusion mechanism
like a header guard or #import, one header will get a FileChanged
callback, and another FileSkipped.

So that we get an accurate dependency file, we therefore need to also
implement the FileSkipped callback in dependency scanning.

Patch by Pete Cooper.

Reviewers: bruno, pete

Reviewed By: bruno

Subscribers: cfe-commits, jkorous, vsapsai

Differential Revision: https://reviews.llvm.org/D30881

llvm-svn: 331319
clang/lib/Frontend/DependencyFile.cpp
clang/test/Frontend/Inputs/SystemHeaderPrefix/with-header-guard.h [new file with mode: 0644]
clang/test/Frontend/dependency-gen-symlink.c [new file with mode: 0644]