llvm-project
d39772cb - [lldb] Refactor variable annotation logic in Disassembler::PrintInstructions (#156118)

Commit
31 days ago
[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.
Parents
Loading