[Lldb-commits] [PATCH] D154759: [lldb][NFCI] Change type of UnwindPlan::m_source_name

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 10 18:09:16 PDT 2023


bulbazord added a comment.

In D154759#4487381 <https://reviews.llvm.org/D154759#4487381>, @jasonmolenda wrote:

> I guess simplest is we can have all the UnwindPlan creators have a `static g_unwindplan_name` and save a pointer to that.  Each one is unique, don't need anything fancier than that. There's the risk that someone will create a new UnwindPlan and forget to make it a static string, so unwind logging would try to print random memory, but it wouldn't break normal debugging.

I was thinking about this earlier, since we know what all the possible strings are going to be, we can create them all statically at compile time and just point to them. We can refactor a bit and then most of these source names just become `static const char *` or `static constexpr llvm::StringLiteral` or something like this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154759



More information about the lldb-commits mailing list