[clang] [compiler-rt] [clang-repl] Reimplement value printing using MemoryAccess to support in-process and out-of-process (PR #156649)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 9 23:52:17 PDT 2025


================
@@ -267,92 +267,156 @@ std::string Interpreter::ValueDataToString(const Value &V) const {
       return "{ error: unknown builtin type '" + std::to_string(BT->getKind()) +
              " '}";
     case clang::BuiltinType::Bool:
-      SS << ((V.getBool()) ? "true" : "false");
-      return Str;
-    case clang::BuiltinType::Char_S:
-      SS << '\'' << V.getChar_S() << '\'';
-      return Str;
-    case clang::BuiltinType::SChar:
-      SS << '\'' << V.getSChar() << '\'';
-      return Str;
-    case clang::BuiltinType::Char_U:
-      SS << '\'' << V.getChar_U() << '\'';
-      return Str;
-    case clang::BuiltinType::UChar:
-      SS << '\'' << V.getUChar() << '\'';
+      SS << ((B.as<bool>()) ? "true" : "false");
       return Str;
     case clang::BuiltinType::Short:
-      SS << V.getShort();
+      SS << B.as<short>();
----------------
SahilPatidar wrote:

I’m working on a new design inspired by `clang::APValue`, intended to replace `Value` so it can support both execution environments:https://gist.github.com/SahilPatidar/9ba885fb29aebc68b6cf788b8937a204

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


More information about the llvm-commits mailing list