================
@@ -57,6 +57,22 @@ bool fromJSON(const json::Value &Params, MessageType &M, 
json::Path P) {
   return true;
 }
 
+json::Value toJSON(const String &S) {
+  if (LLVM_LIKELY(llvm::json::isUTF8(std::string(S))))
+    return std::string(S);
+  return llvm::json::fixUTF8(std::string(S));
+}
+
+bool fromJSON(const llvm::json::Value &Param, String &Str,
+              llvm::json::Path Path) {
+  if (auto s = Param.getAsString()) {
+    Str = *s;
----------------
DrSergei wrote:

nit: `*std::move(s)` to avoid copy

https://github.com/llvm/llvm-project/pull/181261
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to