]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove old symbol_matches_domain
authorTom Tromey <tom@tromey.com>
Fri, 1 Sep 2023 20:29:33 +0000 (14:29 -0600)
committerTom Tromey <tom@tromey.com>
Sun, 28 Jan 2024 17:58:16 +0000 (10:58 -0700)
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
gdb/symtab.h

index 5735786ac44b450a0b5874e558f79f66e889eaeb..b85883559212438028a26ec0e3bd80b1e7b3982d 100644 (file)
@@ -2676,26 +2676,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
index 8e1d219281b769b0882856f472460e9351b190cc..3029f60cb4bc6994539ca8fa72627b9a118e8c6b 100644 (file)
@@ -1242,10 +1242,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
@@ -1307,13 +1303,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;