[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
Fri Jul 18 07:21:04 PDT 2025


================
@@ -3,9 +3,80 @@
 // RUN: cat %s | clang-repl -Xcc -xc  | FileCheck %s
 // RUN: cat %s | clang-repl -Xcc -std=c++11 | FileCheck %s
 
-// Fails with `Symbols not found: [ __clang_Interpreter_SetValueNoAlloc ]`.
 // UNSUPPORTED: hwasan
 
+
+char c = 'a'; c
+// CHECK: (char) 'a'
+
 const char* c_str = "Hello, world!"; c_str
+// CHECK-NEXT: (const char *) "Hello, world!"
+
+c_str = "Goodbye, world!"; c_str
+// CHECK-NEXT: (const char *) "Goodbye, world!"
+
+const char* c_null_str = 0; c_null_str
+// CHECK-NEXT: (const char *) 0
+
+"Hello, world"
+// CHECK-NEXT: ({{(const )?}}char[13]) "Hello, world"
+
+int x = 42; x
+// CHECK-NEXT: (int) 42
+
+&x
+// CHECK-NEXT: (int *) @0x{{[0-9a-f]+}}
+
+x - 2
+// CHECK-NEXT: (int) 40
+
+float f = 4.2f; f
+// CHECK-NEXT: (float) 4.20000f
+
+double d = 4.21; d
+// CHECK-NEXT: (double) 4.2100000
+
+long double tau = 6.2831853; tau
+// CHECK-NEXT: (long double) 6.28318530000L
----------------
vgvassilev wrote:

Makes sense. I am aiming to land this over the weekend to have time to meditate on these things :)

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


More information about the cfe-commits mailing list