[all-commits] [llvm/llvm-project] d39772: [lldb] Refactor variable annotation logic in Disas...

Abdullah Mohammad Amin via All-commits all-commits at lists.llvm.org
Sat Aug 30 13:17:27 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d39772cb053c194ef809f3ca765f37237c4e1956
      https://github.com/llvm/llvm-project/commit/d39772cb053c194ef809f3ca765f37237c4e1956
  Author: Abdullah Mohammad Amin <abdullahmohammad155 at gmail.com>
  Date:   2025-08-30 (Sat, 30 Aug 2025)

  Changed paths:
    M lldb/include/lldb/Core/Disassembler.h
    M lldb/source/Core/Disassembler.cpp

  Log Message:
  -----------
  [lldb] Refactor variable annotation logic in Disassembler::PrintInstructions (#156118)

This patch is a follow-up to
[#152887](https://github.com/llvm/llvm-project/pull/152887), addressing
review comments that came in after the original change was merged.

- Move `VarState` definition out of `PrintInstructions` into a private
helper, with member comments placed before fields.
- Introduce a `VariableAnnotator` helper class to encapsulate state and
logic for live variable tracking across instructions.
- Replace `seen_this_inst` flag with a map-diff approach: recompute the
current variable set per instruction and diff against the previous set.
- Use `nullptr` instead of an empty `ProcessSP` when calling
`ABI::FindPlugin`.
- Narrow `Block*` scope with `if (Block *B = ...)`.
- Set `DIDumpOptions::PrintRegisterOnly` directly from
`static_cast<bool>(abi_sp)`.
- Prefer `emplace_back` over `push_back` for event strings.
- General cleanup to match LLVM coding style and reviewer feedback.

This makes the annotation code easier to read and consistent with
LLVM/LLDB conventions while preserving functionality.



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