]> granicus.if.org Git - clang/commit
rewrite-includes: Rewrite __has_include(_next) to get rid of a host dependency.
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 16 Apr 2013 19:08:41 +0000 (19:08 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 16 Apr 2013 19:08:41 +0000 (19:08 +0000)
commit596eea7cc26979c952a0b177d024787a99b299df
tree109fdb515aefd3f15bceb876d7d51e12fee4a940
parent051303ce09291dfbed537fa33b0d8a4d92c82b75
rewrite-includes: Rewrite __has_include(_next) to get rid of a host dependency.

This broke e.g. compiling a crash report from a glibc system on Darwin. Sadly,
the implementation had to game the lexer a lot as we're not using a real
preprocessor here. It also doesn't handle special cases like arbitrary macros in
__has_include, but since this macro isn't common outside of clang's headers we
can get away with that.

Fixes PR14422.

Differential Revision: http://llvm-reviews.chandlerc.com/D594

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179616 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Rewrite/Frontend/InclusionRewriter.cpp
test/Frontend/Inputs/rewrite-includes8.h [new file with mode: 0644]
test/Frontend/rewrite-includes-invalid-hasinclude.c [new file with mode: 0644]
test/Frontend/rewrite-includes.c