[Lex] Consider a PCH header-guarded even with #endif truncated
authorSam McCall <sam.mccall@gmail.com>
Sat, 17 Jul 2021 00:23:51 +0000 (02:23 +0200)
committerSam McCall <sam.mccall@gmail.com>
Tue, 20 Jul 2021 12:25:36 +0000 (14:25 +0200)
commitfd2278505482bd9db21423b0620be6afe04feb60
tree73a784571e8d7ebaf3d17a28dec660f318f77698
parenteb03fa1d2c05bad5a5f75a89d47b4b31d84bb90b
[Lex] Consider a PCH header-guarded even with #endif truncated

This seems to be a more useful behavior for tools that use preambles.
I believe it doesn't affect real compiles: the PCH is only included once
when used, and recursive inclusion of the main-file *within* the PCH
isn't supported in any case.

Differential Revision: https://reviews.llvm.org/D106204
clang-tools-extra/clangd/unittests/ParsedASTTests.cpp
clang/lib/Lex/Lexer.cpp