[Lldb-commits] [PATCH] D139082: [lldb][Module] Document ModuleList::ForEach and assert nullness

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 1 17:20:48 PST 2022


Michael137 added a comment.

In D139082#3965316 <https://reviews.llvm.org/D139082#3965316>, @aprantl wrote:

> If we assert non-null, why still pass a shared pointer? Could we have the lambda take a `Module &`?

I took a stab at changing it to pass a reference but turns out there's several places where we end up storing the shared_ptr. If we changed this to a reference we'd have to call shared_from_this for those cases. Which is a bit iffy considering calling it on references that are not shared_ptr owned would throw (which can't happen currently but seems similarly awkward to the current API).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139082/new/

https://reviews.llvm.org/D139082



More information about the lldb-commits mailing list