[13/29] Remove a check of VAR_DOMAIN

Message ID 20231120-submit-domain-hacks-2-v1-13-29650d01b198@tromey.com
State New
Headers
Series Restructure symbol domains |

Commit Message

Tom Tromey Nov. 21, 2023, 3:53 a.m. UTC
  completion_list_add_symbol checks that the returned symbol has
VAR_DOMAIN, but also checks that its address class is LOC_BLOCK.  The
domain check is redundant -- only functions can possibly be LOC_BLOCK
-- and leaving this in place will cause a regression when combined
with a later patch in this series.  This patch preemptively removes
the redundant check.
---
 gdb/symtab.c | 1 -
 1 file changed, 1 deletion(-)
  

Patch

diff --git a/gdb/symtab.c b/gdb/symtab.c
index e5e168c20e9..3159e5d2cea 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -5534,7 +5534,6 @@  completion_list_add_symbol (completion_tracker &tracker,
      the msymbol name and removes the msymbol name from the completion
      tracker.  */
   if (sym->language () == language_cplus
-      && sym->domain () == VAR_DOMAIN
       && sym->aclass () == LOC_BLOCK)
     {
       /* The call to canonicalize returns the empty string if the input