[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-16 Thread Jun Zhang via Phabricator via cfe-commits
junaire added a comment. Because I have edited the commit messages several times so I forgot to include the revision link. Sorry. I have landed it as https://reviews.llvm.org/rGa423b7f1d7ca8b263af85944f57a69aa08fc942c Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-16 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 522545. junaire added a comment. remove whitespace Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Interpreter/Interpreter.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM aside from a teeny tiny whitespace nit. Comment at: clang/include/clang/Interpreter/Value.h:27 +// devices where the JIT infrastructure cannot fit. To support that we will need +// to split the memory

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-16 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. I believe we are at the stage of better is enemy of good now. This looks good to me. I'd recommend to wait for @aaron.ballman's final review. Repository: rG LLVM Github

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-16 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 522530. junaire added a comment. Address comment from Vassil, thx Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files:

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-16 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added inline comments. Comment at: clang/include/clang/Interpreter/Value.h:23 +// +// NOTE: Since the REPL itself could also include this runtime, extreme caution +// should be taken when MAKING CHANGES to this file, especially when INCLUDE NEW I

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-16 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 522527. junaire added a comment. Add comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Interpreter/Interpreter.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Interpreter/Value.h:160-162 + // Interpreter, QualType are stored as void* to reduce dependencies. + void *Interp = nullptr; + void *OpaqueType = nullptr; junaire wrote: > v.g.vassilev

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-12 Thread Jun Zhang via Phabricator via cfe-commits
junaire marked 10 inline comments as done. junaire added inline comments. Comment at: clang/include/clang/Interpreter/Value.h:160-162 + // Interpreter, QualType are stored as void* to reduce dependencies. + void *Interp = nullptr; + void *OpaqueType = nullptr;

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-08 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 520326. junaire marked an inline comment as done. junaire added a comment. . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files:

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

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

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-08 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added inline comments. Comment at: clang/include/clang/Interpreter/Value.h:160-162 + // Interpreter, QualType are stored as void* to reduce dependencies. + void *Interp = nullptr; + void *OpaqueType = nullptr; sgraenitz wrote: > v.g.vassilev

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-08 Thread Stefan Gränitz via Phabricator via cfe-commits
sgraenitz added a comment. In D141215#4272538 , @lhames wrote: > using regular global variable instances to manage the storage on the executor > side, an extended `MemoryAccess` interface to read/write the value from the > REPL side when needed (e.g.

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-07 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added inline comments. Comment at: clang/include/clang/Interpreter/Value.h:160-162 + // Interpreter, QualType are stored as void* to reduce dependencies. + void *Interp = nullptr; + void *OpaqueType = nullptr; aaron.ballman wrote: > junaire

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Interpreter/Value.h:46 + +#define REPL_BUILTIN_TYPES \ + X(bool, Bool) \

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-02 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 518961. junaire added a comment. Fix typos Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Interpreter/Interpreter.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-02 Thread Jun Zhang via Phabricator via cfe-commits
junaire added inline comments. Comment at: clang/include/clang/Interpreter/Interpreter.h:59 + + Value LastValue; v.g.vassilev wrote: > aaron.ballman wrote: > > I think I'm surprised to see this as a data member of `Interpreter` but > > mostly because my

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-02 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 518960. junaire marked 2 inline comments as done. junaire added a comment. Add more comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files:

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-02 Thread Jun Zhang via Phabricator via cfe-commits
junaire added inline comments. Comment at: clang/include/clang/Interpreter/Value.h:46 + +#define REPL_BUILTIN_TYPES \ + X(bool, Bool) \

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-02 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 518952. junaire marked 16 inline comments as done. junaire added a comment. Address comments from @aaron.ballman, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Interpreter/Value.h:46 + +#define REPL_BUILTIN_TYPES \ + X(bool, Bool) \

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-05-01 Thread Jun Zhang via Phabricator via cfe-commits
junaire marked an inline comment as done. junaire added inline comments. Comment at: clang/lib/Interpreter/Interpreter.cpp:211 +void __clang_Interpreter_SetValueNoAlloc(void*,void*,void*,unsigned long long); +template +void __clang_Interpreter_SetValueCopyArr(T*

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

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

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-30 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 518292. junaire added a comment. . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Interpreter/Interpreter.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-30 Thread Jun Zhang via Phabricator via cfe-commits
junaire added inline comments. Comment at: clang/include/clang/Interpreter/Value.h:121 +static T cast(const Value ) { + if (V.isPointerOrObjectType()) +return (T)(uintptr_t)V.getAs(); aaron.ballman wrote: > v.g.vassilev wrote: > > aaron.ballman

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-30 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 518290. junaire added a comment. . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Interpreter/Interpreter.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-30 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 518285. junaire marked 3 inline comments as done. junaire added a comment. Only enable __clang_Interpreter_SetValueCopyArr support in C++ mode. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-30 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. Thanks again for your efforts pushing this patch. It has gone a long way and I believe we are getting there. Comment at: clang/include/clang/Interpreter/Value.h:46 + +#define REPL_BUILTIN_TYPES

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-29 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 518265. junaire added a comment. Add unittests for void & member pointers types Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files:

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-29 Thread Jun Zhang via Phabricator via cfe-commits
junaire added inline comments. Comment at: clang/include/clang/Interpreter/Interpreter.h:96 + + size_t getEffectivePTUSize() const; + aaron.ballman wrote: > It looks like this can be private? > > Also, just a note (not something you have to deal with in this

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-29 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 518166. junaire marked 4 inline comments as done. junaire added a comment. Partially address some comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files:

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Interpreter/Interpreter.h:96 + + size_t getEffectivePTUSize() const; + It looks like this can be private? Also, just a note (not something you have to deal with in this review), the local

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-28 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 517829. junaire added a comment. fix windows buildbots Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Interpreter/Interpreter.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-22 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 516081. junaire added a comment. Rebuild, please. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Interpreter/Interpreter.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-22 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 516080. junaire added a comment. Break the IsSemiMissing/ repl_input_end parts out from the Value part Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files:

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-16 Thread Lang Hames via Phabricator via cfe-commits
lhames added a comment. > OTOH it's a challenge to review since the patch is really big. Is there no > way to break it up and test in isolation? Or strip away details that could be > added in iterations? I had a short look and some comments, but I won't find > the time in the coming weeks to

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-16 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. I added some of background and historical notes. I hope that helps. Comment at: clang/include/clang/Interpreter/Interpreter.h:59 + + Value LastValue; aaron.ballman wrote: > I think I'm surprised to see this as a data member of

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-15 Thread Jun Zhang via Phabricator via cfe-commits
junaire marked an inline comment as done. junaire added inline comments. Comment at: clang/include/clang/Interpreter/Value.h:98 + QualType getType() const; + Interpreter () const; + sgraenitz wrote: > Can we make this private and try not to introduce more

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-15 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 513954. junaire marked an inline comment as done. junaire added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files:

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-15 Thread Jun Zhang via Phabricator via cfe-commits
junaire marked an inline comment as done. junaire added inline comments. Comment at: clang/include/clang/Interpreter/Value.h:83 + Value() = default; + Value(void /*Interpreter*/ *In, void /*QualType*/ *Ty); + Value(const Value ); aaron.ballman wrote: > Why do

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-15 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 513926. junaire marked an inline comment as done. junaire added a comment. Address more comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files:

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-15 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:7226 + // assert(DeferredDeclsToEmit.empty() && + //"Should have emitted all decls deferred to emit."); assert(NewBuilder->DeferredDecls.empty() && aaron.ballman

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-15 Thread Jun Zhang via Phabricator via cfe-commits
junaire marked 4 inline comments as done. junaire added inline comments. Comment at: clang/include/clang/Interpreter/Interpreter.h:83 /// mangled name. llvm::Expected getSymbolAddress(GlobalDecl GD) const; sgraenitz wrote: > Most of the Orc and JITLink

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-15 Thread Jun Zhang via Phabricator via cfe-commits
junaire marked 16 inline comments as done. junaire added inline comments. Comment at: clang/include/clang/Interpreter/Interpreter.h:72 + llvm::Error ParseAndExecute(llvm::StringRef Code, Value *V = nullptr); + llvm::Expected CompileDtorCall(CXXRecordDecl *CXXRD);

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-15 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 513918. junaire added a comment. Address some comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/AST/Decl.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-13 Thread Stefan Gränitz via Phabricator via cfe-commits
sgraenitz added a comment. This looks a lot better already than the implementation I know from Cling. Well done! OTOH it's a challenge to review since the patch is really big. Is there no way to break it up and test in isolation? Or strip away details that could be added in iterations? I had

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I've not done a complete review yet, but I got started on it and have a handful of comments. Comment at: clang/include/clang/Basic/TokenKinds.def:945 +// Annotation for end of input in clang-repl. +ANNOTATION(input_end) + Should

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-12 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 512869. junaire added a comment. fix ci Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/AST/Decl.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-12 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 512837. junaire added a comment. dont include if we don't have it Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/AST/Decl.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-12 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 512801. junaire added a comment. use unsigned long instead of std::size_t when including the runtimes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files:

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-10 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added reviewers: aaron.ballman, rsmith, lhames, sgraenitz. v.g.vassilev added a comment. I think it is a good time to invite more reviewers to take a look at this patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-10 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 512075. junaire added a comment. Use IncrementalParser::GetMangledName instead Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files:

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-10 Thread Jun Zhang via Phabricator via cfe-commits
junaire marked 6 inline comments as done. junaire added inline comments. Comment at: clang/include/clang/Interpreter/Interpreter.h:67 create(std::unique_ptr CI); + ASTContext () const; const CompilerInstance *getCompilerInstance() const; v.g.vassilev

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-09 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 512073. junaire added a comment. fix some nits Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/AST/Decl.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-09 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 512072. junaire added a comment. Address some comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/AST/Decl.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-09 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added inline comments. Comment at: clang/include/clang/Interpreter/Interpreter.h:97 + + enum InterfaceKind { NoAlloc, WithAlloc, CopyArray }; + junaire wrote: > v.g.vassilev wrote: > > junaire wrote: > > > v.g.vassilev wrote: > > > > This can

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-09 Thread Jun Zhang via Phabricator via cfe-commits
junaire added inline comments. Comment at: clang/include/clang/Interpreter/Interpreter.h:97 + + enum InterfaceKind { NoAlloc, WithAlloc, CopyArray }; + v.g.vassilev wrote: > junaire wrote: > > v.g.vassilev wrote: > > > This can probably go in the

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-09 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added inline comments. Comment at: clang/include/clang/Interpreter/Interpreter.h:97 + + enum InterfaceKind { NoAlloc, WithAlloc, CopyArray }; + junaire wrote: > v.g.vassilev wrote: > > This can probably go in the RuntimeInterfaceBuilder class. > We

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-09 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 511999. junaire added a comment. Address some comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/AST/Decl.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-09 Thread Jun Zhang via Phabricator via cfe-commits
junaire added inline comments. Comment at: clang/include/clang/Interpreter/Interpreter.h:97 + + enum InterfaceKind { NoAlloc, WithAlloc, CopyArray }; + v.g.vassilev wrote: > This can probably go in the RuntimeInterfaceBuilder class. We need it. See: ``` class

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-09 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added inline comments. Comment at: clang/lib/Interpreter/Interpreter.cpp:383 + +static std::string MangleName(ASTContext , GlobalDecl GD) { + std::unique_ptr MangleC(C.createMangleContext()); I suspect we could use

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-09 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 MissingSemi; } + void setValuePrinting(bool Missing = true) { MissingSemi = Missing; } We should rename these to `isMissingSemi` or

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-09 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 511984. junaire added a comment. Refactor how we compile a destructor Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/AST/Decl.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-08 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 511870. junaire added a comment. Remove some unnecessary code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/AST/Decl.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-08 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 511867. junaire added a comment. Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/AST/Decl.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-08 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added inline comments. Comment at: clang/include/clang/Interpreter/Interpreter.h:39 +class Parser; +class CodeGenerator; class CompilerInstance; v.g.vassilev wrote: > We probably do not need these forward declarations. Looks like they came back.

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-08 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 511862. junaire added a comment. Clean up the patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/AST/Decl.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

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

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-05 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 511090. junaire added a comment. Remove old code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/AST/Decl.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-05 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 511084. junaire added a comment. Add IncrementalASTConsumer Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/AST/Decl.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-05 Thread Thorsten via Phabricator via cfe-commits
tschuett added inline comments. Comment at: clang/lib/Interpreter/Interpreter.cpp:198 +// These better to put in a runtime header but we can't. This is because we +// can't find the percise resource directory in unittests so we have to hard +// code them.

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-04 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added inline comments. Comment at: clang/include/clang/Sema/Sema.h:2211 + std::optional> ValuePrintingTransformer; + Instead of doing this, we could implement an ASTConsumer which the Interpreter can attach to Sema and listen for

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-04 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 510885. junaire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/AST/Decl.h

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-02 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added inline comments. Comment at: clang/lib/Parse/ParseStmt.cpp:554 +// Otherwise, eat the semicolon. +ExpectAndConsumeSemi(diag::err_expected_semi_after_expr); + } We seem to have more than one call to

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-01 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 510286. junaire added a comment. Fix known memory issues. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Basic/TokenKinds.def

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-04-01 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 510226. junaire added a comment. I dont know why the premerge tests are failling, let me try to do a update... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files:

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-03-31 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 510167. junaire added a comment. Update. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Basic/TokenKinds.def

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-03-31 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 510017. junaire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Basic/TokenKinds.def

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-03-31 Thread Jun Zhang via Phabricator via cfe-commits
junaire marked 9 inline comments as done. junaire added inline comments. Comment at: clang/include/clang/Interpreter/Interpreter.h:119 + + std::unique_ptr GenModule(); + v.g.vassilev wrote: > We should not need this interface. `Interpreter::CompileDecl` needs

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-03-31 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 510014. junaire added a comment. Address more comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Basic/TokenKinds.def

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-03-31 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added inline comments. Comment at: clang/include/clang/Interpreter/Interpreter.h:20 +#include "clang/Interpreter/PartialTranslationUnit.h" +#include "clang/Interpreter/Value.h" We can forward declare `Value`. Comment at:

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-03-31 Thread Jun Zhang via Phabricator via cfe-commits
junaire marked 3 inline comments as done. junaire added inline comments. Comment at: clang/lib/Interpreter/IncrementalParser.cpp:162 + if (P->getCurToken().is(tok::annot_input_end)) { +P->ConsumeAnyToken(); // FIXME: Clang does not call ExitScope on finalizing the

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-03-31 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 509958. junaire added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Basic/TokenKinds.def

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-03-31 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. Overall it looks like we are heading in a good direction. Here are some initial comments from my partial review. Comment at: clang/include/clang/Interpreter/Interpreter.h:109 + std::list (); + std::unique_ptr GenModule(); + Do

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-03-29 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 509311. junaire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Basic/TokenKinds.def

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-03-29 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 509307. junaire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Basic/TokenKinds.def

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-03-29 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 509305. junaire added a comment. Update + Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Basic/TokenKinds.def

[PATCH] D141215: [clang-repl] Introduce Value to capture expression results

2023-03-24 Thread Jun Zhang via Phabricator via cfe-commits
junaire updated this revision to Diff 508072. junaire added a comment. Update comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141215/new/ https://reviews.llvm.org/D141215 Files: clang/include/clang/Basic/TokenKinds.def