[Lldb-commits] [lldb] [lldb] Return *const* UnwindPlan pointers from FuncUnwinders (PR #133247)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 31 08:10:43 PDT 2025


================
@@ -36,18 +36,19 @@ class FuncUnwinders {
 
   ~FuncUnwinders();
 
-  lldb::UnwindPlanSP GetUnwindPlanAtCallSite(Target &target, Thread &thread);
+  std::shared_ptr<const UnwindPlan> GetUnwindPlanAtCallSite(Target &target,
----------------
JDevlieghere wrote:

Makes sense.

> One idea I have had that could solve this (but have never found the time to propose) is to replace the individual FoobarSP typedefs with a SP = std::shared_ptr<T> template alias. That would let us write SP<const Foobar> in exactly the places which need it; and it might also help with the hypothetical migration to the llvm naming convention (frees up FoobarSP as a member name)

Yeah, I remember you suggesting that in https://reviews.llvm.org/D133906. At the time I played around with a regex/python script to replace the existing `FoobarSP`s and it somehow was a lot harder to get right than I expected. 

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


More information about the lldb-commits mailing list