Add a callback for `__has_include` and use it for dependency scanning.
authorVolodymyr Sapsai <vsapsai@apple.com>
Tue, 18 Sep 2018 23:27:02 +0000 (23:27 +0000)
committerVolodymyr Sapsai <vsapsai@apple.com>
Tue, 18 Sep 2018 23:27:02 +0000 (23:27 +0000)
commita4c53284c131bdd1ba2d330d918f42159af4eee2
tree7b4f9f003435cc449adc070693a14da3a9bce6e4
parent78381c63ae076f17092236b4e4c80df7fc222f15
Add a callback for `__has_include` and use it for dependency scanning.

This adds a preprocessor callback for the `__has_include` and
`__has_include_next` directives.

Successful checking for the presence of a header should add it to the list of
header dependencies so this overrides the callback in the dependency scanner.

Patch by Pete Cooper with some additions by me.

rdar://problem/39545636

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

llvm-svn: 342517
clang/include/clang/Lex/PPCallbacks.h
clang/lib/Frontend/DependencyFile.cpp
clang/lib/Lex/PPMacroExpansion.cpp
clang/test/Frontend/dependency-gen-has-include.c [new file with mode: 0644]