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

Ben Langmuir via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 16 11:23:26 PDT 2017


benlangmuir added inline comments.


================
Comment at: lib/Lex/PPDirectives.cpp:2774
+    // the directive blocks.
+    CurPPLexer->pushConditionalLevel(CI.IfLoc, /*wasskip*/false,
+                                   /*foundnonskip*/true, /*foundelse*/true);
----------------
akyrtzi wrote:
> 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.
Thanks for explaining. That makes sense to me.


https://reviews.llvm.org/D34263





More information about the cfe-commits mailing list