[PATCH] D146809: [WIP][clang-repl] Implement Value pretty printing

Jun Zhang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 24 06:35:29 PDT 2023


junaire created this revision.
Herald added a subscriber: mstorsjo.
Herald added a project: All.
junaire requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patch implements Value::dump related code so the pretty printing
will work.

The problem for the patch is that it doesn't work with 'template types'
like all the STL components. For exmaple:
clang-repl> #include <memory>
clang-repl> auto p = std::make_shared<int>(42);
clang-repl> p

JIT session error: Symbols not found: [ _Z17PrintValueRuntimeIiENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPSt10shared_ptrIT_E ]
(shared_ptr<int> &) ERROR: Failed to materialize symbols: { (main, { _Z23__InterpreterCallPrint1B5cxx11v }) }

RFC: https://discourse.llvm.org/t/rfc-handle-execution-results-in-clang-repl/68493

Signed-off-by: Jun Zhang <jun at junz.org>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146809

Files:
  clang/lib/Headers/CMakeLists.txt
  clang/lib/Headers/__clang_interpreter_runtime_printvalue.h
  clang/lib/Interpreter/CMakeLists.txt
  clang/lib/Interpreter/Value.cpp
  clang/lib/Interpreter/ValuePrinter.cpp
  clang/test/Interpreter/pretty-print.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146809.508073.patch
Type: text/x-patch
Size: 29835 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230324/ee39bdb8/attachment-0001.bin>


More information about the cfe-commits mailing list