[PATCH] D158415: [Lex] Handle repl_input_end in Preprocessor::LexAll()

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 21 05:09:10 PDT 2023


Hahnfeld created this revision.
Hahnfeld added reviewers: aaron.ballman, v.g.vassilev.
Herald added a project: All.
Hahnfeld requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This fixes many unit tests when trying to enable `IncrementalExtensions` by default for testing purposes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158415

Files:
  clang/lib/Lex/Preprocessor.cpp


Index: clang/lib/Lex/Preprocessor.cpp
===================================================================
--- clang/lib/Lex/Preprocessor.cpp
+++ clang/lib/Lex/Preprocessor.cpp
@@ -1000,7 +1000,7 @@
   while (1) {
     Token tok;
     Lex(tok);
-    if (tok.is(tok::eof))
+    if (tok.isOneOf(tok::eof, tok::annot_repl_input_end))
       break;
     toks.push_back(tok);
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158415.551990.patch
Type: text/x-patch
Size: 375 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230821/e595dc78/attachment.bin>


More information about the cfe-commits mailing list