================
@@ -55,6 +55,12 @@ void AddFilter(TypeCategoryImpl::SharedPointer category_sp,
 
 std::optional<size_t> ExtractIndexFromString(const char *item_name);
 
+/// Returns \c false if the smart pointer formatters shouldn't continue
+/// formatting the rest of the object. Currently this is the case when the
+/// pointer is a nullptr.
+bool DumpCxxSmartPtrPointerSummary(Stream &stream, ValueObject &ptr,
+                                   const TypeSummaryOptions &options);
----------------
labath wrote:

Is it actually needed though? In my experiments, a normally constructed empty 
shared pointer will have these as `__ctrl_` field as null anyway.

I was able to construct a nullptr shared_ptr with a non-empty control field 
using the subobject constructor (`std::shared_ptr<int> si(new int(47)); 
std::shared_ptr<int> sie(si, nullptr);`), but in that case, maybe we actually 
should show the weak and shared counts?


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

Reply via email to