[all-commits] [llvm/llvm-project] 78060a: [lldb] Clean up UnwindAssemblyInstEmulation (#129030)

Pavel Labath via All-commits all-commits at lists.llvm.org
Mon Mar 10 03:14:06 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 78060a7df7adcae8674f189699fa97cd1eb7bafa
      https://github.com/llvm/llvm-project/commit/78060a7df7adcae8674f189699fa97cd1eb7bafa
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2025-03-10 (Mon, 10 Mar 2025)

  Changed paths:
    M lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
    M lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h

  Log Message:
  -----------
  [lldb] Clean up UnwindAssemblyInstEmulation (#129030)

My main motivation was trying to understand how the function and whether
the rows need to be (shared) pointers. I noticed that the function
essentially constructs two copies unwind plans in parallel (the second
being the saved_unwind_states).

If we delay the construction of the unwind plan to the end of the
function, then we never need two copies of a single row (we can just
move it into the final result), so we can just use them as value types.
This makes the overall logic of the function stand out better as it
avoids the laborious deep copies of the Row shared pointer.

I've also noticed that a large portion of the function is devoted to
recomputing certain properties of the unwind state (e.g. the
`m_fp_is_cfa` field). Instead of doing that, this patch just
saves/restores them together with the rest of the state.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list