[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 14 22:16:53 PDT 2025


================
@@ -119,9 +119,9 @@ class REPL_EXTERNAL_VISIBILITY Value {
   ~Value();
 
   void printType(llvm::raw_ostream &Out) const;
-  void printData(llvm::raw_ostream &Out) const;
-  void print(llvm::raw_ostream &Out) const;
-  void dump() const;
+  void printData(llvm::raw_ostream &Out);
+  void print(llvm::raw_ostream &Out);
+  void dump();
----------------
vgvassilev wrote:

Yes, the problem is that for objects in C++ with non-trivial destructors we need to call the object destructor when the `Value` is destroyed. When creating the `Value` object we need to get the destructor symbol in `CompileDtorCall`. We store the destructor-symbol pair for performance reasons and we store that in a map. I've marked the map `mutable` and we should probably be good to go.

https://github.com/llvm/llvm-project/pull/148701


More information about the cfe-commits mailing list