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

2023-08-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D148997#4561620 , @v.g.vassilev wrote: > In D148997#4561614 , @bnbarham > wrote: > >> In D148997#4561577 , @v.g.vassilev >> wrote: >>

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

2023-08-23 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. In D148997#4607833 , @bnbarham wrote: > In D148997#4561620 , @v.g.vassilev > wrote: > >> So, in that case we should bring back the boolean flag for incremental >> processing and kee

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

2023-08-22 Thread Ben Barham via Phabricator via cfe-commits
bnbarham added a comment. In D148997#4561620 , @v.g.vassilev wrote: > So, in that case we should bring back the boolean flag for incremental > processing and keep the `IncrementalExtensions` LanguageOption separate. In > that case `IncrementalExtension

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

2023-08-04 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. In D148997#4561614 , @bnbarham wrote: > In D148997#4561577 , @v.g.vassilev > wrote: > >>> My other concern here is that it seems our use cases are somewhat >>> different, eg. we wou

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

2023-08-04 Thread Ben Barham via Phabricator via cfe-commits
bnbarham added a comment. In D148997#4561577 , @v.g.vassilev wrote: >> My other concern here is that it seems our use cases are somewhat different, >> eg. we wouldn't want any parsing differences and while I don't know why this >> is yet, the removal o

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

2023-08-04 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. In D148997#4561516 , @bnbarham wrote: > In D148997#4561211 , @v.g.vassilev > wrote: > > https://github.com/llvm/llvm-project/blob/df6b35e329ebecad6dc3bfb83183e482eb7a0020/clang/l

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

2023-08-04 Thread Ben Barham via Phabricator via cfe-commits
bnbarham added a comment. In D148997#4561211 , @v.g.vassilev wrote: https://github.com/llvm/llvm-project/blob/df6b35e329ebecad6dc3bfb83183e482eb7a0020/clang/lib/Parse/ParseExprCXX.cpp#L4070 >>> >>> That looks a bit obscure to me. Looks like we are t

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

2023-08-04 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. In D148997#4561068 , @bnbarham wrote: > In D148997#4561022 , @v.g.vassilev > wrote: > >> I meant that I'd like to figure out if we could use the >> `annot_repl_input_end` before con

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

2023-08-04 Thread Ben Barham via Phabricator via cfe-commits
bnbarham added a comment. In D148997#4561022 , @v.g.vassilev wrote: > I meant that I'd like to figure out if we could use the > `annot_repl_input_end` before considering a new flag. Oh sure, that's why I'm here :). Just trying to figure out what we thi

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

2023-08-04 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. In D148997#4561015 , @bnbarham wrote: > In D148997#4559788 , @v.g.vassilev > wrote: > >> I'd prefer to avoid adding a new flag. Is there a way to see how does the >> diff looks like

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

2023-08-04 Thread Ben Barham via Phabricator via cfe-commits
bnbarham added a comment. In D148997#4559788 , @v.g.vassilev wrote: > I'd prefer to avoid adding a new flag. Is there a way to see how does the > diff looks like? You mean for a new flag? I don't have one prepared, but it would basically just be addin

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

2023-08-04 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. In 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 > ass

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

2023-08-03 Thread Ben Barham via Phabricator via cfe-commits
bnbarham added a comment. > 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 c

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

2023-05-16 Thread Jun Zhang via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG247fa04116a6: [clang] Add a new annotation token: annot_repl_input_end (authored by junaire). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148997/new/ http

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

2023-05-15 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev accepted this revision. v.g.vassilev added a comment. This revision is now accepted and ready to land. LGTM! Thanks for putting so much efforts into this! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148997/new/ https://reviews.llvm.o

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

2023-05-08 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 520313. junaire added a comment. Update + Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148997/new/ https://reviews.llvm.org/D148997 Files: clang/include/clang/AST/Decl.h clang/include/clang/Basic/T

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

2023-05-08 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. @rsmith, any ideas how to support value printing of constructs such as `int i = 12`, eg, that's not a top-level statement declaration but worth printing its value? It is the shorthand of `int i = 12; i`. Comment at: clang/lib/CodeGen/CodeGenModul

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

2023-05-08 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added inline comments. Comment at: clang/include/clang/AST/Decl.h:4345 + } + bool isValuePrinting() const { return IsSemiMissing; } + void setValuePrinting(bool Missing = true) { IsSemiMissing = Missing; } We should change the accessors to the new

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

2023-05-02 Thread Jun Zhang via Phabricator via cfe-commits
junaire added inline comments. Comment at: clang/lib/Interpreter/IncrementalParser.cpp:162 + if (P->getCurToken().is(tok::annot_repl_input_end)) { +P->ConsumeAnyToken(); // FIXME: Clang does not call ExitScope on finalizing the regular TU, we rsmith wro

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

2023-05-02 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 518738. junaire marked 3 inline comments as done. junaire added a comment. Address comments, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148997/new/ https://reviews.llvm.org/D148997 Files: clang/in

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

2023-05-01 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. This looks like a nice improvement to me. Comment at: clang/lib/Interpreter/IncrementalParser.cpp:162 + if (P->getCurToken().is(tok::annot_repl_input_end)) { +P->ConsumeAnyToken(); // FIXME: Clang does not call ExitScope on finalizing the regul

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

2023-05-01 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 518448. junaire added a comment. . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148997/new/ https://reviews.llvm.org/D148997 Files: clang/include/clang/AST/Decl.h clang/include/clang/Basic/TokenKinds.def

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

2023-04-28 Thread Jun Zhang via Phabricator via cfe-commits
junaire added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:7219 void CodeGenModule::moveLazyEmissionStates(CodeGenModule *NewBuilder) { - assert(DeferredDeclsToEmit.empty() && - "Should have emitted all decls deferred to emit."); + // FIXME: Re-enab

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

2023-04-28 Thread Jun Zhang via Phabricator via cfe-commits
junaire added a comment. This patch is part of D141215 . I split it as some jit people requested. I don't know if there's a good way to test the patch, please leave a comment if you have an idea. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

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

2023-04-22 Thread Jun Zhang via Phabricator via cfe-commits
junaire created this revision. Herald added a project: All. junaire requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch is the first part of the below RFC: https://discourse.llvm.org/t/rfc-handle-execution-results-in-clang-repl/68493