[PATCH] D148997: [clang] Add a new annotation token: annot_repl_input_end

Vassil Vassilev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 4 00:12:27 PDT 2023


v.g.vassilev added a comment.

In D148997#4559646 <https://reviews.llvm.org/D148997#4559646>, @bnbarham wrote:

>> Are there other users of incremental processing mode, other than the REPL / IncrementalParser?
>
> It seems Swift's clang importer also uses incremental processing mode, I'm assuming to keep the `TUScope` and `CurLexer` alive after EOF. We also end up using the same context with various actions, which leads to a few hangs as there's various checks for `eof` only, eg. `ReadPCHAndPreprocessAction`, `PreprocessOnlyAction`, and `RewriteIncludesAction`. There's also quite a few places in the parser that only check for `eof` as well (I just grepped for `Tok.isNot(tok::eof)`).
>
> Should these all be updated to handle `annot_repl_input_end` or should we instead have a different flag that we set for this purpose instead of co-opting `isIncrementalProcessingEnabled`?

I'd prefer to avoid adding a new flag. Is there a way to see how does the diff looks like? Maybe it would make more sense to use the `annot_repl_input_end` token? If the token name does not capture well the generic use-case I am happy to change it to something better.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148997



More information about the cfe-commits mailing list