[PATCH] D53866: [Preamble] Fix preamble for circular #includes
Nikolai Kosjar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 31 04:22:32 PDT 2018
nik added a comment.
In https://reviews.llvm.org/D53866#1281978, @ilya-biryukov wrote:
> Why does resetting the conditional stack is the right thing to do here?
Because this case can be detected and handled without loosing the benefits of the preamble.
> Failing to build the preamble in that case seems like the best thing we could do. WDYT?
See above - we would not have the benefits of the preamble anymore.
> I can see how it can hide the problem, but can't come up with with a consistent model to handle the fact that the file contents were trimmed.
If we are in preamble-generation-mode and the main file #includes itself, then it should see the full file content of the file, not the truncated preamble version of it.
Would this be more consistent?
Repository:
rC Clang
https://reviews.llvm.org/D53866
More information about the cfe-commits
mailing list