[all-commits] [llvm/llvm-project] 4017dc: [lldb][Commands][NFC] image lookup: remove unused ...

Michael Buch via All-commits all-commits at lists.llvm.org
Thu Jul 3 02:29:11 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4017dc06e3b5c4b97d8b1089070f88363e0db6f0
      https://github.com/llvm/llvm-project/commit/4017dc06e3b5c4b97d8b1089070f88363e0db6f0
  Author: Michael Buch <michaelbuch12 at gmail.com>
  Date:   2025-07-03 (Thu, 03 Jul 2025)

  Changed paths:
    M lldb/source/Commands/CommandObjectTarget.cpp

  Log Message:
  -----------
  [lldb][Commands][NFC] image lookup: remove unused local variable (#146554)

The `current_module` pointer here was never set, but we check it when
looping over the `target_modules` list. Presumably the intention was to
avoid calling `LookupInModule` if we already found the type in the
current module. This patch removes this `current_module`. If we decide
the output below is not what the user should see, we can revisit the
implementation.

Current output:
```
(lldb) im loo -vt Foo --all
Best match found in /Users/jonas/Git/llvm-worktrees/llvm-project/a.out:
id = {0x00000037}, name = "Foo", byte-size = 1, decl = foo.cpp:1, compiler_type = "struct Foo {
}"

1 match found in /Users/jonas/Git/llvm-worktrees/llvm-project/a.out:
id = {0x00000037}, name = "Foo", byte-size = 1, decl = foo.cpp:1, compiler_type = "struct Foo {
}"
```
which seems fine.

Note, there can be multiple matches *within* the current module, so if
we did the naive thing of skipping the `current_module` when printing
with `--all`, then we would miss some matches.



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