[18/29] Remove old symbol_matches_domain

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

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply

Commit Message

Tom Tromey Nov. 21, 2023, 3:53 a.m. UTC
  Nothing calls the variant of symbol_matches_domain that accepts a
domain_enum for searching, so this patch removes it and the
corresponding symbol::matches.
---
 gdb/symtab.c | 20 --------------------
 gdb/symtab.h | 11 -----------
 2 files changed, 31 deletions(-)
  

Patch

diff --git a/gdb/symtab.c b/gdb/symtab.c
index 4a5d6ef5792..874e475cd61 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -2675,26 +2675,6 @@  lookup_global_symbol (const char *name,
     return bs;
 }
 
-bool
-symbol_matches_domain (enum language symbol_language,
-		       domain_enum symbol_domain,
-		       domain_enum domain)
-{
-  /* For C++ "struct foo { ... }" also defines a typedef for "foo".
-     Similarly, any Ada type declaration implicitly defines a typedef.  */
-  if (symbol_language == language_cplus
-      || symbol_language == language_d
-      || symbol_language == language_ada
-      || symbol_language == language_rust)
-    {
-      if ((domain == VAR_DOMAIN || domain == STRUCT_DOMAIN)
-	  && symbol_domain == STRUCT_DOMAIN)
-	return true;
-    }
-  /* For all other languages, strict match is required.  */
-  return (symbol_domain == domain);
-}
-
 /* See symtab.h.  */
 
 bool
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 414fa29e863..e44420e458b 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1236,10 +1236,6 @@  enum symbol_subclass_kind
 
 extern gdb::array_view<const struct symbol_impl> symbol_impls;
 
-bool symbol_matches_domain (enum language symbol_language,
-			    domain_enum symbol_domain,
-			    domain_enum domain);
-
 /* This structure is space critical.  See space comments at the top.  */
 
 struct symbol : public general_symbol_info, public allocate_on_obstack
@@ -1286,13 +1282,6 @@  struct symbol : public general_symbol_info, public allocate_on_obstack
     return this->impl ().aclass;
   }
 
-  /* Call symbol_matches_domain on this symbol, using the symbol's
-     domain.  */
-  bool matches (domain_enum d) const
-  {
-    return symbol_matches_domain (language (), domain (), d);
-  }
-
   /* Return true if this symbol's domain matches FLAGS.  */
   bool matches (domain_search_flags flags) const;