@@ -40,64 +40,45 @@ Properties::~Properties() = default;
40
40
lldb::OptionValueSP
41
41
Properties::GetPropertyValue (const ExecutionContext *exe_ctx,
42
42
llvm::StringRef path, Status &error) const {
43
- OptionValuePropertiesSP properties_sp (GetValueProperties ());
44
- if (properties_sp)
45
- return properties_sp->GetSubValue (exe_ctx, path, error);
46
- return lldb::OptionValueSP ();
43
+ return m_collection_sp->GetSubValue (exe_ctx, path, error);
47
44
}
48
45
49
46
Status Properties::SetPropertyValue (const ExecutionContext *exe_ctx,
50
47
VarSetOperationType op,
51
48
llvm::StringRef path,
52
49
llvm::StringRef value) {
53
- OptionValuePropertiesSP properties_sp (GetValueProperties ());
54
- if (properties_sp)
55
- return properties_sp->SetSubValue (exe_ctx, op, path, value);
56
- return Status::FromErrorString (" no properties" );
50
+ return m_collection_sp->SetSubValue (exe_ctx, op, path, value);
57
51
}
58
52
59
53
void Properties::DumpAllPropertyValues (const ExecutionContext *exe_ctx,
60
54
Stream &strm, uint32_t dump_mask,
61
55
bool is_json) {
62
- OptionValuePropertiesSP properties_sp (GetValueProperties ());
63
- if (!properties_sp)
64
- return ;
65
-
66
56
if (is_json) {
67
- llvm::json::Value json = properties_sp ->ToJSON (exe_ctx);
57
+ llvm::json::Value json = m_collection_sp ->ToJSON (exe_ctx);
68
58
strm.Printf (" %s" , llvm::formatv (" {0:2}" , json).str ().c_str ());
69
59
} else
70
- properties_sp ->DumpValue (exe_ctx, strm, dump_mask);
60
+ m_collection_sp ->DumpValue (exe_ctx, strm, dump_mask);
71
61
}
72
62
73
63
void Properties::DumpAllDescriptions (CommandInterpreter &interpreter,
74
64
Stream &strm) const {
75
65
strm.PutCString (" Top level variables:\n\n " );
76
66
77
- OptionValuePropertiesSP properties_sp (GetValueProperties ());
78
- if (properties_sp)
79
- return properties_sp->DumpAllDescriptions (interpreter, strm);
67
+ return m_collection_sp->DumpAllDescriptions (interpreter, strm);
80
68
}
81
69
82
70
Status Properties::DumpPropertyValue (const ExecutionContext *exe_ctx,
83
71
Stream &strm,
84
72
llvm::StringRef property_path,
85
73
uint32_t dump_mask, bool is_json) {
86
- OptionValuePropertiesSP properties_sp (GetValueProperties ());
87
- if (properties_sp) {
88
- return properties_sp->DumpPropertyValue (exe_ctx, strm, property_path,
74
+ return m_collection_sp->DumpPropertyValue (exe_ctx, strm, property_path,
89
75
dump_mask, is_json);
90
- }
91
- return Status::FromErrorString (" empty property list" );
92
76
}
93
77
94
78
size_t
95
79
Properties::Apropos (llvm::StringRef keyword,
96
80
std::vector<const Property *> &matching_properties) const {
97
- OptionValuePropertiesSP properties_sp (GetValueProperties ());
98
- if (properties_sp) {
99
- properties_sp->Apropos (keyword, matching_properties);
100
- }
81
+ m_collection_sp->Apropos (keyword, matching_properties);
101
82
return matching_properties.size ();
102
83
}
103
84
0 commit comments