[PATCH] D101192: Add support for #elifdef and #elifndef

Melanie Blower via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 26 06:46:00 PDT 2021


mibintc added a comment.

Wow thanks for doing this! I worked on it a couple days a while ago but I abandoned the effort and went back to my day job.  It seems like preprocessing ought to be something like a "state machine" but I couldn't figure out the mechanism. Would it make sense to add some kind of high level description of the components, now that you've gone to the [presumably massive] effort of understanding it? Just a couple small comments above.



================
Comment at: clang/lib/Lex/PPDirectives.cpp:1059
+    case tok::pp_elifdef:
+      return HandleElifdefDirective(Result, SavedHash, false,
+                                    true /*not valid for miopt*/);
----------------
please put a comment on 'false'


================
Comment at: clang/lib/Lex/PPDirectives.cpp:1063
+      return HandleElifdefDirective(Result, SavedHash, true,
+                                    ReadAnyTokensBeforeDirective);
     case tok::pp_else:
----------------
please put a comment on true 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101192/new/

https://reviews.llvm.org/D101192



More information about the cfe-commits mailing list