================
@@ -81,6 +81,40 @@ class StructuredDataImpl {
 
   void SetObjectSP(const StructuredData::ObjectSP &obj) { m_data_sp = obj; }
 
+  void SetValueForKey(llvm::StringRef key,
+                      const StructuredData::ObjectSP &value) {
+    if (m_data_sp) {
+      if (StructuredData::Dictionary *dict = m_data_sp->GetAsDictionary())
+        dict->AddItem(key, value);
+      return;
+    }
+    m_data_sp = StructuredData::FromKeyValue(key, value);
+  }
+
+  void SetUnsignedIntegerValue(uint64_t value) {
+    m_data_sp = StructuredData::FromInteger(value);
+  }
+
+  void SetSignedIntegerValue(int64_t value) {
+    m_data_sp = StructuredData::FromInteger(value);
+  }
+
+  void SetFloatValue(double value) {
+    m_data_sp = StructuredData::FromFloat(value);
+  }
+
+  void SetBooleanValue(bool value) {
+    m_data_sp = StructuredData::FromBoolean(value);
+  }
+
+  void SetStringValue(std::string value) {
+    m_data_sp = StructuredData::FromString(value);
----------------
bulbazord wrote:

Suggestion: Move here to avoid an unnecessary copy

https://github.com/llvm/llvm-project/pull/154445
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to