[PATCH] D34263: [preprocessor] When preprocessor option 'SingleFileParseMode' is enabled, parse all directive blocks if the condition uses undefined macros

Argyrios Kyrtzidis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 16 11:19:08 PDT 2017


akyrtzi added inline comments.


================
Comment at: lib/Lex/PPDirectives.cpp:2774
+    // the directive blocks.
+    CurPPLexer->pushConditionalLevel(CI.IfLoc, /*wasskip*/false,
+                                   /*foundnonskip*/true, /*foundelse*/true);
----------------
benlangmuir wrote:
> Why is wasSkipping false here?
For `#if` it sets `wasskip` to `true` to indicate later for `HandleElseDirective` that the block should not be skipped.
But here (inside `HandleElseDirective`) setting `wasskip` doesn't really affect anything, the `HandleEndifDirective` doesn't check it. I chose to set it to `false` as indication that the `#else` block does get parsed.


https://reviews.llvm.org/D34263





More information about the cfe-commits mailing list