[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 23 09:55:51 PDT 2018


dexonsmith added a comment.

In https://reviews.llvm.org/D30882#1075576, @pete wrote:

> Oh, that actually wasn't my intention when I wrote it.
>
> Honestly I didn't expect it to log anything for missing paths at all, as we don't currently log all the missing (but attempted) paths for regular #include's.


Then I misunderstood the patch.  Maybe add a test or two that confirms it only adds dependencies, not anti-dependencies?

> Would it be ok to turn this on by default, without a flag, only in the case of the path actually existing, and only the found path being the one we add to the .d?

I think that pessimizes some incremental builds:

- You have a `__has_include("missing.h")`, but don't include missing.h.
- Change "missing.h" (but don't delete it).
- An incremental build now has to rebuild the object file, even though nothing will have changed.

However, it's fixing an actual bug, so it makes sense to me to be more conservative.


https://reviews.llvm.org/D30882





More information about the cfe-commits mailing list