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

Jun Zhang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 9 06:16:16 PDT 2023


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 RuntimeInterfaceBuilder
    : public TypeVisitor<RuntimeInterfaceBuilder, Interpreter::InterfaceKind> {
   ...
}
```


================
Comment at: clang/lib/Interpreter/Interpreter.cpp:350
   std::list<PartialTranslationUnit> &PTUs = IncrParser->getPTUs();
-  if (N > PTUs.size())
+  if (N + InitPTUSize > PTUs.size())
     return llvm::make_error<llvm::StringError>("Operation failed. "
----------------
v.g.vassilev wrote:
> v.g.vassilev wrote:
> > I'd propose `IncrParser->getPTUs()` to return the list starting from `InitPTUSize`. That should solve the issue you see.
> Ping.
I'm uncertain about how to do this. Can you elaborate?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141215



More information about the cfe-commits mailing list