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

Vassil Vassilev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 4 22:44:47 PDT 2023


v.g.vassilev added inline comments.


================
Comment at: clang/include/clang/Sema/Sema.h:2211
 
+  std::optional<std::function<FunctionDecl *(Expr *)>> ValuePrintingTransformer;
+
----------------
Instead of doing this, we could implement an ASTConsumer which the Interpreter can attach to Sema and listen for `HandleTopLevelDecl`. If we encounter a `TopLevelStmtDecl` we add our facilities and pass it to CodeGen.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:7226
+  // assert(DeferredDeclsToEmit.empty() &&
+  //        "Should have emitted all decls deferred to emit.");
   assert(NewBuilder->DeferredDecls.empty() &&
----------------
That should probably be a separate review with a testcase.


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