+2020-06-02 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * ada-lang.c (ada_language_data): Delete la_search_name_hash
+ initializer.
+ * c-lang.c (c_language_data): Likewise.
+ (cplus_language_data): Likewise.
+ (cplus_language::search_name_hash): New member function.
+ (asm_language_data): Delete la_search_name_hash initializer.
+ (minimal_language_data): Likewise.
+ * d-lang.c (d_language_data): Likewise.
+ * dictionary.c (default_search_name_hash): Rename to...
+ (language_defn::search_name_hash): ...this.
+ * f-lang.c (f_language_data): Likewise.
+ (f_language::search_name_hash): New member function.
+ * go-lang.c (go_language_data): Delete la_search_name_hash
+ initializer.
+ * language.c (unknown_language_data): Likewise.
+ (auto_language_data): Likewise.
+ * language.h (struct language_data): Delete la_search_name_hash
+ field.
+ (language_defn::search_name_hash): Declare new member function.
+ (default_search_name_hash): Delete declaration.
+ * m2-lang.c (m2_language_data): Delete la_search_name_hash
+ initializer.
+ * objc-lang.c (objc_language_data): Likewise.
+ * opencl-lang.c (opencl_language_data): Likewise.
+ * p-lang.c (pascal_language_data): Likewise.
+ * rust-lang.c (rust_language_data): Likewise.
+ * symtab.c (search_name_hash): Update call.
+
2020-06-02 Andrew Burgess <andrew.burgess@embecosm.com>
* ada-lang.c (ada_language_data): Delete la_get_compile_instance
ada_collect_symbol_completion_matches,
ada_watch_location_expression,
ada_get_symbol_name_matcher, /* la_get_symbol_name_matcher */
- default_search_name_hash,
&ada_varobj_ops,
NULL,
ada_is_string_type,
default_collect_symbol_completion_matches,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
- default_search_name_hash,
&c_varobj_ops,
c_compute_program,
c_is_string_type_p,
default_collect_symbol_completion_matches,
c_watch_location_expression,
cp_get_symbol_name_matcher,
- cp_search_name_hash,
&cplus_varobj_ops,
cplus_compute_program,
c_is_string_type_p,
{
return cplus_get_compile_context ();
}
+
+ /* See language.h. */
+ unsigned int search_name_hash (const char *name) const override
+ {
+ return cp_search_name_hash (name);
+ }
};
/* The single instance of the C++ language class. */
default_collect_symbol_completion_matches,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
- default_search_name_hash,
&default_varobj_ops,
NULL,
c_is_string_type_p,
default_collect_symbol_completion_matches,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
- default_search_name_hash,
&default_varobj_ops,
NULL,
c_is_string_type_p,
default_collect_symbol_completion_matches,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
- default_search_name_hash,
&default_varobj_ops,
NULL,
c_is_string_type_p,
/* See dictionary.h. */
unsigned int
-default_search_name_hash (const char *string0)
+language_defn::search_name_hash (const char *string0) const
{
/* The Ada-encoded version of a name P1.P2...Pn has either the form
P1__P2__...Pn<suffix> or _ada_P1__P2__...Pn<suffix> (where the Pi
f_collect_symbol_completion_matches,
c_watch_location_expression,
cp_get_symbol_name_matcher, /* la_get_symbol_name_matcher */
- cp_search_name_hash,
&default_varobj_ops,
NULL,
f_is_string_type_p,
lai->bool_type_symbol = "logical";
lai->bool_type_default = builtin->builtin_logical_s2;
}
+
+ /* See language.h. */
+ unsigned int search_name_hash (const char *name) const override
+ {
+ return cp_search_name_hash (name);
+ }
};
/* Single instance of the Fortran language class. */
default_collect_symbol_completion_matches,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
- default_search_name_hash,
&default_varobj_ops,
NULL,
go_is_string_type_p,
default_collect_symbol_completion_matches,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
- default_search_name_hash,
&default_varobj_ops,
NULL,
default_is_string_type_p,
default_collect_symbol_completion_matches,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
- default_search_name_hash,
&default_varobj_ops,
NULL,
default_is_string_type_p,
symbol_name_matcher_ftype *(*la_get_symbol_name_matcher)
(const lookup_name_info &);
- /* Hash the given symbol search name. Use
- default_search_name_hash if no special treatment is
- required. */
- unsigned int (*la_search_name_hash) (const char *name);
-
/* Various operations on varobj. */
const struct lang_varobj_ops *la_varobj_ops;
return nullptr;
}
+ /* Hash the given symbol search name. */
+ virtual unsigned int search_name_hash (const char *name) const;
+
/* List of all known languages. */
static const struct language_defn *languages[nr_languages];
};
void default_print_typedef (struct type *type, struct symbol *new_symbol,
struct ui_file *stream);
-/* Default name hashing function. */
-
-/* Produce an unsigned hash value from SEARCH_NAME that is consistent
- with strcmp_iw, strcmp, and, at least on Ada symbols, wild_match.
- That is, two identifiers equivalent according to any of those three
- comparison operators hash to the same value. */
-extern unsigned int default_search_name_hash (const char *search_name);
-
void c_get_string (struct value *value,
gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
int *length, struct type **char_type,
default_collect_symbol_completion_matches,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
- default_search_name_hash,
&default_varobj_ops,
NULL,
m2_is_string_type_p,
default_collect_symbol_completion_matches,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
- default_search_name_hash,
&default_varobj_ops,
NULL,
c_is_string_type_p,
default_collect_symbol_completion_matches,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
- default_search_name_hash,
&default_varobj_ops,
NULL,
c_is_string_type_p,
default_collect_symbol_completion_matches,
c_watch_location_expression,
NULL, /* la_compare_symbol_for_completion */
- default_search_name_hash,
&default_varobj_ops,
NULL,
pascal_is_string_type_p,
default_collect_symbol_completion_matches,
rust_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
- default_search_name_hash,
&default_varobj_ops,
NULL,
rust_is_string_type_p,
unsigned int
search_name_hash (enum language language, const char *search_name)
{
- return language_def (language)->la_search_name_hash (search_name);
+ return language_def (language)->search_name_hash (search_name);
}
/* See symtab.h.