[Lldb-commits] [lldb] [lldb/API] Add setters to SBStructuredData (PR #154445)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Tue Aug 19 18:58:27 PDT 2025
================
@@ -81,6 +81,39 @@ class StructuredDataImpl {
void SetObjectSP(const StructuredData::ObjectSP &obj) { m_data_sp = obj; }
+ void SetValueForKey(const char *key,
+ const StructuredData::ObjectSP &value) const {
+ if (m_data_sp) {
+ auto dict = m_data_sp->GetAsDictionary();
+ if (dict)
+ return dict->AddItem(key, value);
----------------
JDevlieghere wrote:
The type isn't obvious form the RHS so this shouldn't use `auto`.
```suggestion
if (auto dict = m_data_sp->GetAsDictionary())
return dict->AddItem(key, value);
```
https://github.com/llvm/llvm-project/pull/154445
More information about the lldb-commits
mailing list