Commit 4017dc0
authored
[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.1 parent 58d84a6 commit 4017dc0
1 file changed
+1
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4086 | 4086 | | |
4087 | 4087 | | |
4088 | 4088 | | |
4089 | | - | |
4090 | | - | |
4091 | 4089 | | |
4092 | 4090 | | |
4093 | 4091 | | |
| |||
4110 | 4108 | | |
4111 | 4109 | | |
4112 | 4110 | | |
4113 | | - | |
4114 | | - | |
| 4111 | + | |
4115 | 4112 | | |
4116 | 4113 | | |
4117 | 4114 | | |
| |||
0 commit comments