GNU Binutils with patches for OS216
Revisión | c9debfb97e052c32cf0308157cae529ce2059f48 (tree) |
---|---|
Tiempo | 2020-06-17 17:25:09 |
Autor | Andrew Burgess <andrew.burgess@embe...> |
Commiter | Andrew Burgess |
gdb: Convert language la_get_symbol_name_matcher field to a method
This commit changes the language_data::la_get_symbol_name_matcher
function pointer member variable into a member function of
language_defn.
There should be no user visible changes after this commit.
Before this commit access to the la_get_symbol_name_matcher function
pointer was through the get_symbol_name_matcher function, which looked
something like this (is pseudo-code):
In this commit I moved the get_symbol_name_matcher as a non-virtual
function in the language_defn base class, I then add a new virtual
method that is only used from within get_symbol_name_matcher, this can
then be overridden by specific languages as needed. So we now have:
gdb/ChangeLog:
* ada-lang.c (ada_get_symbol_name_matcher): Update header comment.
(ada_language_data): Delete la_get_symbol_name_matcher
initializer.
(language_defn::get_symbol_name_matcher_inner): New member
function.
* c-lang.c (c_language_data): Delete la_get_symbol_name_matcher
initializer.
(cplus_language_data): Likewise.
(cplus_language::get_symbol_name_matcher_inner): New member
function.
(asm_language_data): Delete la_get_symbol_name_matcher initializer.
(minimal_language_data): Likewise.
* cp-support.h (cp_get_symbol_name_matcher): Update header comment.
* d-lang.c (d_language_data): Delete la_get_symbol_name_matcher
initializer.
* dictionary.c (iter_match_first_hashed): Update call to
get_symbol_name_matcher.
(iter_match_next_hashed): Likewise.
(iter_match_next_linear): Likewise.
* dwarf2/read.c (dw2_expand_symtabs_matching_symbol): Likewise.
* f-lang.c (f_language_data): Delete la_get_symbol_name_matcher
initializer.
(f_language::get_symbol_name_matcher_inner): New member function.
* go-lang.c (go_language_data): Delete la_get_symbol_name_matcher
initializer.
* language.c (default_symbol_name_matcher): Update header comment,
make static.
(language_defn::get_symbol_name_matcher): New definition.
(language_defn::get_symbol_name_matcher_inner): Likewise.
(get_symbol_name_matcher): Delete.
(unknown_language_data): Delete la_get_symbol_name_matcher
initializer.
(auto_language_data): Likewise.
* language.h (language_data): Delete la_get_symbol_name_matcher
field.
(language_defn::get_symbol_name_matcher): New member function.
(language_defn::get_symbol_name_matcher_inner): Likewise.
(default_symbol_name_matcher): Delete declaration.
* linespec.c (find_methods): Update call to
get_symbol_name_matcher.
* m2-lang.c (m2_language_data): Delete la_get_symbol_name_matcher
initializer.
* minsyms.c (lookup_minimal_symbol): Update call to
get_symbol_name_matcher.
(iterate_over_minimal_symbols): Likewise.
* objc-lang.c (objc_language_data): Delete
la_get_symbol_name_matcher initializer.
* opencl-lang.c (opencl_language_data): Likewise.
* p-lang.c (pascal_language_data): Likewise.
* psymtab.c (psymbol_name_matches): Update call to
get_symbol_name_matcher.
* rust-lang.c (rust_language_data): Delete
la_get_symbol_name_matcher initializer.
* symtab.c (symbol_matches_search_name): Update call to
get_symbol_name_matcher.
(compare_symbol_name): Likewise.
@@ -1,5 +1,64 @@ | ||
1 | 1 | 2020-06-17 Andrew Burgess <andrew.burgess@embecosm.com> |
2 | 2 | |
3 | + * ada-lang.c (ada_get_symbol_name_matcher): Update header comment. | |
4 | + (ada_language_data): Delete la_get_symbol_name_matcher | |
5 | + initializer. | |
6 | + (language_defn::get_symbol_name_matcher_inner): New member | |
7 | + function. | |
8 | + * c-lang.c (c_language_data): Delete la_get_symbol_name_matcher | |
9 | + initializer. | |
10 | + (cplus_language_data): Likewise. | |
11 | + (cplus_language::get_symbol_name_matcher_inner): New member | |
12 | + function. | |
13 | + (asm_language_data): Delete la_get_symbol_name_matcher initializer. | |
14 | + (minimal_language_data): Likewise. | |
15 | + * cp-support.h (cp_get_symbol_name_matcher): Update header comment. | |
16 | + * d-lang.c (d_language_data): Delete la_get_symbol_name_matcher | |
17 | + initializer. | |
18 | + * dictionary.c (iter_match_first_hashed): Update call to | |
19 | + get_symbol_name_matcher. | |
20 | + (iter_match_next_hashed): Likewise. | |
21 | + (iter_match_next_linear): Likewise. | |
22 | + * dwarf2/read.c (dw2_expand_symtabs_matching_symbol): Likewise. | |
23 | + * f-lang.c (f_language_data): Delete la_get_symbol_name_matcher | |
24 | + initializer. | |
25 | + (f_language::get_symbol_name_matcher_inner): New member function. | |
26 | + * go-lang.c (go_language_data): Delete la_get_symbol_name_matcher | |
27 | + initializer. | |
28 | + * language.c (default_symbol_name_matcher): Update header comment, | |
29 | + make static. | |
30 | + (language_defn::get_symbol_name_matcher): New definition. | |
31 | + (language_defn::get_symbol_name_matcher_inner): Likewise. | |
32 | + (get_symbol_name_matcher): Delete. | |
33 | + (unknown_language_data): Delete la_get_symbol_name_matcher | |
34 | + initializer. | |
35 | + (auto_language_data): Likewise. | |
36 | + * language.h (language_data): Delete la_get_symbol_name_matcher | |
37 | + field. | |
38 | + (language_defn::get_symbol_name_matcher): New member function. | |
39 | + (language_defn::get_symbol_name_matcher_inner): Likewise. | |
40 | + (default_symbol_name_matcher): Delete declaration. | |
41 | + * linespec.c (find_methods): Update call to | |
42 | + get_symbol_name_matcher. | |
43 | + * m2-lang.c (m2_language_data): Delete la_get_symbol_name_matcher | |
44 | + initializer. | |
45 | + * minsyms.c (lookup_minimal_symbol): Update call to | |
46 | + get_symbol_name_matcher. | |
47 | + (iterate_over_minimal_symbols): Likewise. | |
48 | + * objc-lang.c (objc_language_data): Delete | |
49 | + la_get_symbol_name_matcher initializer. | |
50 | + * opencl-lang.c (opencl_language_data): Likewise. | |
51 | + * p-lang.c (pascal_language_data): Likewise. | |
52 | + * psymtab.c (psymbol_name_matches): Update call to | |
53 | + get_symbol_name_matcher. | |
54 | + * rust-lang.c (rust_language_data): Delete | |
55 | + la_get_symbol_name_matcher initializer. | |
56 | + * symtab.c (symbol_matches_search_name): Update call to | |
57 | + get_symbol_name_matcher. | |
58 | + (compare_symbol_name): Likewise. | |
59 | + | |
60 | +2020-06-17 Andrew Burgess <andrew.burgess@embecosm.com> | |
61 | + | |
3 | 62 | * ada-lang.c (ada_language_data): Delete la_compute_program |
4 | 63 | initializer. |
5 | 64 | * c-lang.c (c_language_data): Likewise. |
@@ -13862,7 +13862,7 @@ literal_symbol_name_matcher (const char *symbol_search_name, | ||
13862 | 13862 | return false; |
13863 | 13863 | } |
13864 | 13864 | |
13865 | -/* Implement the "la_get_symbol_name_matcher" language_defn method for | |
13865 | +/* Implement the "get_symbol_name_matcher" language_defn method for | |
13866 | 13866 | Ada. */ |
13867 | 13867 | |
13868 | 13868 | static symbol_name_matcher_ftype * |
@@ -13920,7 +13920,6 @@ extern const struct language_data ada_language_data = | ||
13920 | 13920 | ada_get_gdb_completer_word_break_characters, |
13921 | 13921 | ada_collect_symbol_completion_matches, |
13922 | 13922 | ada_watch_location_expression, |
13923 | - ada_get_symbol_name_matcher, /* la_get_symbol_name_matcher */ | |
13924 | 13923 | &ada_varobj_ops, |
13925 | 13924 | ada_is_string_type, |
13926 | 13925 | "(...)" /* la_struct_too_deep_ellipsis */ |
@@ -14105,6 +14104,15 @@ public: | ||
14105 | 14104 | { |
14106 | 14105 | ada_print_type (type, varstring, stream, show, level, flags); |
14107 | 14106 | } |
14107 | + | |
14108 | +protected: | |
14109 | + /* See language.h. */ | |
14110 | + | |
14111 | + symbol_name_matcher_ftype *get_symbol_name_matcher_inner | |
14112 | + (const lookup_name_info &lookup_name) const override | |
14113 | + { | |
14114 | + return ada_get_symbol_name_matcher (lookup_name); | |
14115 | + } | |
14108 | 14116 | }; |
14109 | 14117 | |
14110 | 14118 | /* Single instance of the Ada language class. */ |
@@ -917,7 +917,6 @@ extern const struct language_data c_language_data = | ||
917 | 917 | default_word_break_characters, |
918 | 918 | default_collect_symbol_completion_matches, |
919 | 919 | c_watch_location_expression, |
920 | - NULL, /* la_get_symbol_name_matcher */ | |
921 | 920 | &c_varobj_ops, |
922 | 921 | c_is_string_type_p, |
923 | 922 | "{...}" /* la_struct_too_deep_ellipsis */ |
@@ -1032,7 +1031,6 @@ extern const struct language_data cplus_language_data = | ||
1032 | 1031 | default_word_break_characters, |
1033 | 1032 | default_collect_symbol_completion_matches, |
1034 | 1033 | c_watch_location_expression, |
1035 | - cp_get_symbol_name_matcher, | |
1036 | 1034 | &cplus_varobj_ops, |
1037 | 1035 | c_is_string_type_p, |
1038 | 1036 | "{...}" /* la_struct_too_deep_ellipsis */ |
@@ -1184,6 +1182,16 @@ public: | ||
1184 | 1182 | { |
1185 | 1183 | return cp_class_name_from_physname (physname); |
1186 | 1184 | } |
1185 | + | |
1186 | +protected: | |
1187 | + | |
1188 | + /* See language.h. */ | |
1189 | + | |
1190 | + symbol_name_matcher_ftype *get_symbol_name_matcher_inner | |
1191 | + (const lookup_name_info &lookup_name) const override | |
1192 | + { | |
1193 | + return cp_get_symbol_name_matcher (lookup_name); | |
1194 | + } | |
1187 | 1195 | }; |
1188 | 1196 | |
1189 | 1197 | /* The single instance of the C++ language class. */ |
@@ -1225,7 +1233,6 @@ extern const struct language_data asm_language_data = | ||
1225 | 1233 | default_word_break_characters, |
1226 | 1234 | default_collect_symbol_completion_matches, |
1227 | 1235 | c_watch_location_expression, |
1228 | - NULL, /* la_get_symbol_name_matcher */ | |
1229 | 1236 | &default_varobj_ops, |
1230 | 1237 | c_is_string_type_p, |
1231 | 1238 | "{...}" /* la_struct_too_deep_ellipsis */ |
@@ -1295,7 +1302,6 @@ extern const struct language_data minimal_language_data = | ||
1295 | 1302 | default_word_break_characters, |
1296 | 1303 | default_collect_symbol_completion_matches, |
1297 | 1304 | c_watch_location_expression, |
1298 | - NULL, /* la_get_symbol_name_matcher */ | |
1299 | 1305 | &default_varobj_ops, |
1300 | 1306 | c_is_string_type_p, |
1301 | 1307 | "{...}" /* la_struct_too_deep_ellipsis */ |
@@ -127,8 +127,7 @@ extern struct type *cp_lookup_rtti_type (const char *name, | ||
127 | 127 | "function" or "bar::function" in all namespaces is possible. */ |
128 | 128 | extern unsigned int cp_search_name_hash (const char *search_name); |
129 | 129 | |
130 | -/* Implement the "la_get_symbol_name_matcher" language_defn method for | |
131 | - C++. */ | |
130 | +/* Implement the "get_symbol_name_matcher" language_defn method for C++. */ | |
132 | 131 | extern symbol_name_matcher_ftype *cp_get_symbol_name_matcher |
133 | 132 | (const lookup_name_info &lookup_name); |
134 | 133 |
@@ -160,7 +160,6 @@ extern const struct language_data d_language_data = | ||
160 | 160 | default_word_break_characters, |
161 | 161 | default_collect_symbol_completion_matches, |
162 | 162 | c_watch_location_expression, |
163 | - NULL, /* la_get_symbol_name_matcher */ | |
164 | 163 | &default_varobj_ops, |
165 | 164 | c_is_string_type_p, |
166 | 165 | "{...}" /* la_struct_too_deep_ellipsis */ |
@@ -584,7 +584,7 @@ iter_match_first_hashed (const struct dictionary *dict, | ||
584 | 584 | unsigned int hash_index = (name.search_name_hash (lang->la_language) |
585 | 585 | % DICT_HASHED_NBUCKETS (dict)); |
586 | 586 | symbol_name_matcher_ftype *matches_name |
587 | - = get_symbol_name_matcher (lang, name); | |
587 | + = lang->get_symbol_name_matcher (name); | |
588 | 588 | struct symbol *sym; |
589 | 589 | |
590 | 590 | DICT_ITERATOR_DICT (iterator) = dict; |
@@ -612,7 +612,7 @@ iter_match_next_hashed (const lookup_name_info &name, | ||
612 | 612 | { |
613 | 613 | const language_defn *lang = DICT_LANGUAGE (DICT_ITERATOR_DICT (iterator)); |
614 | 614 | symbol_name_matcher_ftype *matches_name |
615 | - = get_symbol_name_matcher (lang, name); | |
615 | + = lang->get_symbol_name_matcher (name); | |
616 | 616 | struct symbol *next; |
617 | 617 | |
618 | 618 | for (next = DICT_ITERATOR_CURRENT (iterator)->hash_next; |
@@ -828,7 +828,7 @@ iter_match_next_linear (const lookup_name_info &name, | ||
828 | 828 | const struct dictionary *dict = DICT_ITERATOR_DICT (iterator); |
829 | 829 | const language_defn *lang = DICT_LANGUAGE (dict); |
830 | 830 | symbol_name_matcher_ftype *matches_name |
831 | - = get_symbol_name_matcher (lang, name); | |
831 | + = lang->get_symbol_name_matcher (name); | |
832 | 832 | |
833 | 833 | int i, nsyms = DICT_LINEAR_NSYMS (dict); |
834 | 834 | struct symbol *sym, *retval = NULL; |
@@ -4097,7 +4097,7 @@ dw2_expand_symtabs_matching_symbol | ||
4097 | 4097 | |
4098 | 4098 | const language_defn *lang = language_def (lang_e); |
4099 | 4099 | symbol_name_matcher_ftype *name_matcher |
4100 | - = get_symbol_name_matcher (lang, lookup_name_without_params); | |
4100 | + = lang->get_symbol_name_matcher (lookup_name_without_params); | |
4101 | 4101 | |
4102 | 4102 | name_and_matcher key { |
4103 | 4103 | name_matcher, |
@@ -620,7 +620,6 @@ extern const struct language_data f_language_data = | ||
620 | 620 | f_word_break_characters, |
621 | 621 | f_collect_symbol_completion_matches, |
622 | 622 | c_watch_location_expression, |
623 | - cp_get_symbol_name_matcher, /* la_get_symbol_name_matcher */ | |
624 | 623 | &default_varobj_ops, |
625 | 624 | f_is_string_type_p, |
626 | 625 | "(...)" /* la_struct_too_deep_ellipsis */ |
@@ -699,6 +698,16 @@ public: | ||
699 | 698 | { |
700 | 699 | f_print_type (type, varstring, stream, show, level, flags); |
701 | 700 | } |
701 | + | |
702 | +protected: | |
703 | + | |
704 | + /* See language.h. */ | |
705 | + | |
706 | + symbol_name_matcher_ftype *get_symbol_name_matcher_inner | |
707 | + (const lookup_name_info &lookup_name) const override | |
708 | + { | |
709 | + return cp_get_symbol_name_matcher (lookup_name); | |
710 | + } | |
702 | 711 | }; |
703 | 712 | |
704 | 713 | /* Single instance of the Fortran language class. */ |
@@ -545,7 +545,6 @@ extern const struct language_data go_language_data = | ||
545 | 545 | default_word_break_characters, |
546 | 546 | default_collect_symbol_completion_matches, |
547 | 547 | c_watch_location_expression, |
548 | - NULL, /* la_get_symbol_name_matcher */ | |
549 | 548 | &default_varobj_ops, |
550 | 549 | go_is_string_type_p, |
551 | 550 | "{...}" /* la_struct_too_deep_ellipsis */ |
@@ -622,9 +622,10 @@ language_defn::print_array_index (struct type *index_type, LONGEST index, | ||
622 | 622 | fprintf_filtered (stream, "] = "); |
623 | 623 | } |
624 | 624 | |
625 | -/* See language.h. */ | |
625 | +/* The default implementation of the get_symbol_name_matcher_inner method | |
626 | + from the language_defn class. Matches with strncmp_iw. */ | |
626 | 627 | |
627 | -bool | |
628 | +static bool | |
628 | 629 | default_symbol_name_matcher (const char *symbol_search_name, |
629 | 630 | const lookup_name_info &lookup_name, |
630 | 631 | completion_match_result *comp_match_res) |
@@ -649,6 +650,31 @@ default_symbol_name_matcher (const char *symbol_search_name, | ||
649 | 650 | |
650 | 651 | /* See language.h. */ |
651 | 652 | |
653 | +symbol_name_matcher_ftype * | |
654 | +language_defn::get_symbol_name_matcher | |
655 | + (const lookup_name_info &lookup_name) const | |
656 | +{ | |
657 | + /* If currently in Ada mode, and the lookup name is wrapped in | |
658 | + '<...>', hijack all symbol name comparisons using the Ada | |
659 | + matcher, which handles the verbatim matching. */ | |
660 | + if (current_language->la_language == language_ada | |
661 | + && lookup_name.ada ().verbatim_p ()) | |
662 | + return current_language->get_symbol_name_matcher_inner (lookup_name); | |
663 | + | |
664 | + return this->get_symbol_name_matcher_inner (lookup_name); | |
665 | +} | |
666 | + | |
667 | +/* See language.h. */ | |
668 | + | |
669 | +symbol_name_matcher_ftype * | |
670 | +language_defn::get_symbol_name_matcher_inner | |
671 | + (const lookup_name_info &lookup_name) const | |
672 | +{ | |
673 | + return default_symbol_name_matcher; | |
674 | +} | |
675 | + | |
676 | +/* See language.h. */ | |
677 | + | |
652 | 678 | bool |
653 | 679 | default_is_string_type_p (struct type *type) |
654 | 680 | { |
@@ -661,24 +687,6 @@ default_is_string_type_p (struct type *type) | ||
661 | 687 | return (type->code () == TYPE_CODE_STRING); |
662 | 688 | } |
663 | 689 | |
664 | -/* See language.h. */ | |
665 | - | |
666 | -symbol_name_matcher_ftype * | |
667 | -get_symbol_name_matcher (const language_defn *lang, | |
668 | - const lookup_name_info &lookup_name) | |
669 | -{ | |
670 | - /* If currently in Ada mode, and the lookup name is wrapped in | |
671 | - '<...>', hijack all symbol name comparisons using the Ada | |
672 | - matcher, which handles the verbatim matching. */ | |
673 | - if (current_language->la_language == language_ada | |
674 | - && lookup_name.ada ().verbatim_p ()) | |
675 | - return current_language->la_get_symbol_name_matcher (lookup_name); | |
676 | - | |
677 | - if (lang->la_get_symbol_name_matcher != nullptr) | |
678 | - return lang->la_get_symbol_name_matcher (lookup_name); | |
679 | - return default_symbol_name_matcher; | |
680 | -} | |
681 | - | |
682 | 690 | /* Define the language that is no language. */ |
683 | 691 | |
684 | 692 | static int |
@@ -774,7 +782,6 @@ extern const struct language_data unknown_language_data = | ||
774 | 782 | default_word_break_characters, |
775 | 783 | default_collect_symbol_completion_matches, |
776 | 784 | c_watch_location_expression, |
777 | - NULL, /* la_get_symbol_name_matcher */ | |
778 | 785 | &default_varobj_ops, |
779 | 786 | default_is_string_type_p, |
780 | 787 | "{...}" /* la_struct_too_deep_ellipsis */ |
@@ -848,7 +855,6 @@ extern const struct language_data auto_language_data = | ||
848 | 855 | default_word_break_characters, |
849 | 856 | default_collect_symbol_completion_matches, |
850 | 857 | c_watch_location_expression, |
851 | - NULL, /* la_get_symbol_name_matcher */ | |
852 | 858 | &default_varobj_ops, |
853 | 859 | default_is_string_type_p, |
854 | 860 | "{...}" /* la_struct_too_deep_ellipsis */ |
@@ -338,19 +338,6 @@ struct language_data | ||
338 | 338 | gdb::unique_xmalloc_ptr<char> (*la_watch_location_expression) |
339 | 339 | (struct type *type, CORE_ADDR addr); |
340 | 340 | |
341 | - /* Return a pointer to the function that should be used to match a | |
342 | - symbol name against LOOKUP_NAME, according to this language's | |
343 | - rules. The matching algorithm depends on LOOKUP_NAME. For | |
344 | - example, on Ada, the matching algorithm depends on the symbol | |
345 | - name (wild/full/verbatim matching), and on whether we're doing | |
346 | - a normal lookup or a completion match lookup. | |
347 | - | |
348 | - This field may be NULL, in which case | |
349 | - default_symbol_name_matcher is used to perform the | |
350 | - matching. */ | |
351 | - symbol_name_matcher_ftype *(*la_get_symbol_name_matcher) | |
352 | - (const lookup_name_info &); | |
353 | - | |
354 | 341 | /* Various operations on varobj. */ |
355 | 342 | const struct lang_varobj_ops *la_varobj_ops; |
356 | 343 |
@@ -443,6 +430,20 @@ struct language_defn : language_data | ||
443 | 430 | return ::iterate_over_symbols (block, name, domain, callback); |
444 | 431 | } |
445 | 432 | |
433 | + /* Return a pointer to the function that should be used to match a | |
434 | + symbol name against LOOKUP_NAME, according to this language's | |
435 | + rules. The matching algorithm depends on LOOKUP_NAME. For | |
436 | + example, on Ada, the matching algorithm depends on the symbol | |
437 | + name (wild/full/verbatim matching), and on whether we're doing | |
438 | + a normal lookup or a completion match lookup. | |
439 | + | |
440 | + As Ada wants to capture symbol matching for all languages in some | |
441 | + cases, then this method is a non-overridable interface. Languages | |
442 | + should override GET_SYMBOL_NAME_MATCHER_INNER if they need to. */ | |
443 | + | |
444 | + symbol_name_matcher_ftype *get_symbol_name_matcher | |
445 | + (const lookup_name_info &lookup_name) const; | |
446 | + | |
446 | 447 | /* If this language allows compilation from the gdb command line, then |
447 | 448 | this method will return an instance of struct gcc_context appropriate |
448 | 449 | to the language. If compilation for this language is generally |
@@ -530,6 +531,14 @@ struct language_defn : language_data | ||
530 | 531 | |
531 | 532 | /* List of all known languages. */ |
532 | 533 | static const struct language_defn *languages[nr_languages]; |
534 | + | |
535 | +protected: | |
536 | + | |
537 | + /* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method. | |
538 | + See that method for a description of the arguments. */ | |
539 | + | |
540 | + virtual symbol_name_matcher_ftype *get_symbol_name_matcher_inner | |
541 | + (const lookup_name_info &lookup_name) const; | |
533 | 542 | }; |
534 | 543 | |
535 | 544 | /* Pointer to the language_defn for our current language. This pointer |
@@ -698,13 +707,6 @@ void c_get_string (struct value *value, | ||
698 | 707 | int *length, struct type **char_type, |
699 | 708 | const char **charset); |
700 | 709 | |
701 | -/* The default implementation of la_symbol_name_matcher. Matches with | |
702 | - strncmp_iw. */ | |
703 | -extern bool default_symbol_name_matcher | |
704 | - (const char *symbol_search_name, | |
705 | - const lookup_name_info &lookup_name, | |
706 | - completion_match_result *comp_match_res); | |
707 | - | |
708 | 710 | /* Get LANG's symbol_name_matcher method for LOOKUP_NAME. Returns |
709 | 711 | default_symbol_name_matcher if not set. LANG is used as a hint; |
710 | 712 | the function may ignore it depending on the current language and |
@@ -1232,7 +1232,7 @@ find_methods (struct type *t, enum language t_lang, const char *name, | ||
1232 | 1232 | int method_counter; |
1233 | 1233 | lookup_name_info lookup_name (name, symbol_name_match_type::FULL); |
1234 | 1234 | symbol_name_matcher_ftype *symbol_name_compare |
1235 | - = get_symbol_name_matcher (language_def (t_lang), lookup_name); | |
1235 | + = language_def (t_lang)->get_symbol_name_matcher (lookup_name); | |
1236 | 1236 | |
1237 | 1237 | t = check_typedef (t); |
1238 | 1238 |
@@ -379,7 +379,6 @@ extern const struct language_data m2_language_data = | ||
379 | 379 | default_word_break_characters, |
380 | 380 | default_collect_symbol_completion_matches, |
381 | 381 | c_watch_location_expression, |
382 | - NULL, /* la_get_symbol_name_matcher */ | |
383 | 382 | &default_varobj_ops, |
384 | 383 | m2_is_string_type_p, |
385 | 384 | "{...}" /* la_struct_too_deep_ellipsis */ |
@@ -363,8 +363,8 @@ lookup_minimal_symbol (const char *name, const char *sfile, | ||
363 | 363 | % MINIMAL_SYMBOL_HASH_SIZE); |
364 | 364 | |
365 | 365 | symbol_name_matcher_ftype *match |
366 | - = get_symbol_name_matcher (language_def (lang), | |
367 | - lookup_name); | |
366 | + = language_def (lang)->get_symbol_name_matcher | |
367 | + (lookup_name); | |
368 | 368 | struct minimal_symbol **msymbol_demangled_hash |
369 | 369 | = objfile->per_bfd->msymbol_demangled_hash; |
370 | 370 |
@@ -507,7 +507,7 @@ iterate_over_minimal_symbols | ||
507 | 507 | enum language lang = (enum language) liter; |
508 | 508 | const language_defn *lang_def = language_def (lang); |
509 | 509 | symbol_name_matcher_ftype *name_match |
510 | - = get_symbol_name_matcher (lang_def, lookup_name); | |
510 | + = lang_def->get_symbol_name_matcher (lookup_name); | |
511 | 511 | |
512 | 512 | unsigned int hash |
513 | 513 | = lookup_name.search_name_hash (lang) % MINIMAL_SYMBOL_HASH_SIZE; |
@@ -354,7 +354,6 @@ extern const struct language_data objc_language_data = | ||
354 | 354 | default_word_break_characters, |
355 | 355 | default_collect_symbol_completion_matches, |
356 | 356 | c_watch_location_expression, |
357 | - NULL, /* la_get_symbol_name_matcher */ | |
358 | 357 | &default_varobj_ops, |
359 | 358 | c_is_string_type_p, |
360 | 359 | "{...}" /* la_struct_too_deep_ellipsis */ |
@@ -1033,7 +1033,6 @@ extern const struct language_data opencl_language_data = | ||
1033 | 1033 | default_word_break_characters, |
1034 | 1034 | default_collect_symbol_completion_matches, |
1035 | 1035 | c_watch_location_expression, |
1036 | - NULL, /* la_get_symbol_name_matcher */ | |
1037 | 1036 | &default_varobj_ops, |
1038 | 1037 | c_is_string_type_p, |
1039 | 1038 | "{...}" /* la_struct_too_deep_ellipsis */ |
@@ -410,7 +410,6 @@ extern const struct language_data pascal_language_data = | ||
410 | 410 | default_word_break_characters, |
411 | 411 | default_collect_symbol_completion_matches, |
412 | 412 | c_watch_location_expression, |
413 | - NULL, /* la_compare_symbol_for_completion */ | |
414 | 413 | &default_varobj_ops, |
415 | 414 | pascal_is_string_type_p, |
416 | 415 | "{...}" /* la_struct_too_deep_ellipsis */ |
@@ -557,7 +557,7 @@ psymbol_name_matches (partial_symbol *psym, | ||
557 | 557 | { |
558 | 558 | const language_defn *lang = language_def (psym->ginfo.language ()); |
559 | 559 | symbol_name_matcher_ftype *name_match |
560 | - = get_symbol_name_matcher (lang, lookup_name); | |
560 | + = lang->get_symbol_name_matcher (lookup_name); | |
561 | 561 | return name_match (psym->ginfo.search_name (), lookup_name, NULL); |
562 | 562 | } |
563 | 563 |
@@ -2065,7 +2065,6 @@ extern const struct language_data rust_language_data = | ||
2065 | 2065 | default_word_break_characters, |
2066 | 2066 | default_collect_symbol_completion_matches, |
2067 | 2067 | rust_watch_location_expression, |
2068 | - NULL, /* la_get_symbol_name_matcher */ | |
2069 | 2068 | &default_varobj_ops, |
2070 | 2069 | rust_is_string_type_p, |
2071 | 2070 | "{...}" /* la_struct_too_deep_ellipsis */ |
@@ -1016,7 +1016,7 @@ symbol_matches_search_name (const struct general_symbol_info *gsymbol, | ||
1016 | 1016 | const lookup_name_info &name) |
1017 | 1017 | { |
1018 | 1018 | symbol_name_matcher_ftype *name_match |
1019 | - = get_symbol_name_matcher (language_def (gsymbol->language ()), name); | |
1019 | + = language_def (gsymbol->language ())->get_symbol_name_matcher (name); | |
1020 | 1020 | return name_match (gsymbol->search_name (), name, NULL); |
1021 | 1021 | } |
1022 | 1022 |
@@ -5258,7 +5258,7 @@ compare_symbol_name (const char *symbol_name, language symbol_language, | ||
5258 | 5258 | const language_defn *lang = language_def (symbol_language); |
5259 | 5259 | |
5260 | 5260 | symbol_name_matcher_ftype *name_match |
5261 | - = get_symbol_name_matcher (lang, lookup_name); | |
5261 | + = lang->get_symbol_name_matcher (lookup_name); | |
5262 | 5262 | |
5263 | 5263 | return name_match (symbol_name, lookup_name, &match_res); |
5264 | 5264 | } |