@@ -40,64 +40,45 @@ Properties::~Properties() = default;
4040lldb::OptionValueSP
4141Properties::GetPropertyValue (const ExecutionContext *exe_ctx,
4242 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);
4744}
4845
4946Status Properties::SetPropertyValue (const ExecutionContext *exe_ctx,
5047 VarSetOperationType op,
5148 llvm::StringRef path,
5249 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);
5751}
5852
5953void Properties::DumpAllPropertyValues (const ExecutionContext *exe_ctx,
6054 Stream &strm, uint32_t dump_mask,
6155 bool is_json) {
62- OptionValuePropertiesSP properties_sp (GetValueProperties ());
63- if (!properties_sp)
64- return ;
65-
6656 if (is_json) {
67- llvm::json::Value json = properties_sp ->ToJSON (exe_ctx);
57+ llvm::json::Value json = m_collection_sp ->ToJSON (exe_ctx);
6858 strm.Printf (" %s" , llvm::formatv (" {0:2}" , json).str ().c_str ());
6959 } else
70- properties_sp ->DumpValue (exe_ctx, strm, dump_mask);
60+ m_collection_sp ->DumpValue (exe_ctx, strm, dump_mask);
7161}
7262
7363void Properties::DumpAllDescriptions (CommandInterpreter &interpreter,
7464 Stream &strm) const {
7565 strm.PutCString (" Top level variables:\n\n " );
7666
77- OptionValuePropertiesSP properties_sp (GetValueProperties ());
78- if (properties_sp)
79- return properties_sp->DumpAllDescriptions (interpreter, strm);
67+ return m_collection_sp->DumpAllDescriptions (interpreter, strm);
8068}
8169
8270Status Properties::DumpPropertyValue (const ExecutionContext *exe_ctx,
8371 Stream &strm,
8472 llvm::StringRef property_path,
8573 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,
8975 dump_mask, is_json);
90- }
91- return Status::FromErrorString (" empty property list" );
9276}
9377
9478size_t
9579Properties::Apropos (llvm::StringRef keyword,
9680 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);
10182 return matching_properties.size ();
10283}
10384
0 commit comments