sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land.
================ Comment at: clang/lib/Parse/ParsePragma.cpp:2610 EoF.setKind(tok::eof); + EoF.setFlag(clang::Token::IsReinjected); AnnotTok.startToken(); ---------------- It was surprisingly hard for me to see that the changes here were just marking everything in TokenArray as reinjected. Could you do that directly with a loop at the end instead? (It's hard to imagine a significant performance difference) (And the same in all the other modified sites) ================ Comment at: clang/lib/Parse/ParsePragma.cpp:2618 for (; Tok.isNot(tok::eod); PP.Lex(Tok)) { + Tok.setFlag(clang::Token::IsReinjected); TokenVector.push_back(Tok); ---------------- as discussed offline, it wasn't clear to me that this was "in time" as we're not trying to affect the behavior of the subsequent PP.Lex call, not the previous one. Maybe we could extract a function to mark an ArrayRef as reinject with a name that makes this clear. `markAsReinjectedForRelexing()` or something... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98483/new/ https://reviews.llvm.org/D98483 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits