[Lldb-commits] [lldb] [lldb] In-progress — All ValueObjectSP instances are now valid (non-null) but have an error state (PR #74912)

Dave Lee via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 19 15:29:17 PST 2023


kastiglione wrote:

> ### Goal
>
> Every `ValueObjectSP` will have an actual value and will never be equal to `nullptr`.

I would like to learn more about the goal. It seems like the existing code will result in widespread use of `optional<shared_ptr<ValueObject>>`. Is the plan to reduce these cases to a smaller amount? If not, then it's not clear to me how having the codebase predominantly use `optional<shared_ptr<ValueObject>>` is better than mostly using `shared_ptr<ValueObject>`. Is this refactoring a known (named) pattern? Are there other examples of where a `shared_ptr<T>` is replaced with `optional<shared_ptr<T>>`?

https://github.com/llvm/llvm-project/pull/74912


More information about the lldb-commits mailing list