HomePhabricator

[Preamble] Stop circular inclusion of main file when building preamble

Authored by nik on May 10 2019, 3:25 AM.

Description

[Preamble] Stop circular inclusion of main file when building preamble

If a header file was processed for the second time, we could end up with a
wrong conditional stack and skipped ranges:

In the particular example, if the header guard is evaluated the second time and
it is decided to skip the conditional block, the corresponding "#endif" is
never seen since the preamble does not include it and we end up in the
Tok.is(tok::eof) case with a wrong conditional stack.

Detect the circular inclusion, emit a diagnostic and stop processing the
inclusion.

llvm-svn: 360418

Details

Committed
nikMay 10 2019, 3:25 AM
Parents
rGa2ab528c4ca8: [cmake] Remove MSVC C4800 override
Branches
Unknown
Tags
Unknown