diff options
author | Keith Seitz <keiths@redhat.com> | 2014-06-07 10:40:39 -0700 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2014-06-07 10:40:39 -0700 |
commit | 4186eb54dd4d57b59d58f470ec0fa9b19b9c9d5e (patch) | |
tree | a06ca25b09e28008b738dbbda552e4628c4fdbc4 /gdb/ada-lang.c | |
parent | b893397a4b1316610f49819344817715e4305de9 (diff) | |
download | gdb-4186eb54dd4d57b59d58f470ec0fa9b19b9c9d5e.zip gdb-4186eb54dd4d57b59d58f470ec0fa9b19b9c9d5e.tar.gz gdb-4186eb54dd4d57b59d58f470ec0fa9b19b9c9d5e.tar.bz2 |
Revert patchset for c++/16253: it causes a large performance regression.
See the bug for further information.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 65 |
1 files changed, 15 insertions, 50 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index c12fbb8..d7c7e24 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -4393,20 +4393,6 @@ ada_clear_symbol_cache (void) ada_init_symbol_cache (sym_cache); } -/* STRUCT_DOMAIN symbols are also typedefs for the type. This function tests - the equivalency of two Ada symbol domain types. */ - -static int -ada_symbol_matches_domain (domain_enum symbol_domain, domain_enum domain) -{ - if (symbol_domain == domain - || ((domain == VAR_DOMAIN || domain == STRUCT_DOMAIN) - && symbol_domain == STRUCT_DOMAIN)) - return 1; - - return 0; -} - /* Search our cache for an entry matching NAME and NAMESPACE. Return it if found, or NULL otherwise. */ @@ -4508,13 +4494,6 @@ standard_lookup (const char *name, const struct block *block, if (lookup_cached_symbol (name, domain, &sym, NULL)) return sym; sym = lookup_symbol_in_language (name, block, domain, language_c, 0); - - /* STRUCT_DOMAIN symbols also define a typedef for the type. Lookup - a STRUCT_DOMAIN symbol if one is requested for VAR_DOMAIN and not - found. */ - if (sym == NULL && domain == VAR_DOMAIN) - sym = lookup_symbol_in_language (name, block, STRUCT_DOMAIN, language_c, 0); - cache_symbol (name, domain, sym, block_found); return sym; } @@ -5340,29 +5319,13 @@ add_nonlocal_symbols (struct obstack *obstackp, const char *name, data.objfile = objfile; if (is_wild_match) - { - objfile->sf->qf->map_matching_symbols (objfile, name, domain, global, - aux_add_nonlocal_symbols, - &data, wild_match, NULL); - if (domain == VAR_DOMAIN) - objfile->sf->qf->map_matching_symbols (objfile, name, - STRUCT_DOMAIN, global, - aux_add_nonlocal_symbols, - &data, wild_match, NULL); - } + objfile->sf->qf->map_matching_symbols (objfile, name, domain, global, + aux_add_nonlocal_symbols, &data, + wild_match, NULL); else - { - objfile->sf->qf->map_matching_symbols (objfile, name, domain, global, - aux_add_nonlocal_symbols, - &data, full_match, - compare_names); - if (domain == VAR_DOMAIN) - objfile->sf->qf->map_matching_symbols (objfile, name, - STRUCT_DOMAIN, global, - aux_add_nonlocal_symbols, - &data, full_match, - compare_names); - } + objfile->sf->qf->map_matching_symbols (objfile, name, domain, global, + aux_add_nonlocal_symbols, &data, + full_match, compare_names); } if (num_defns_collected (obstackp) == 0 && global && !is_wild_match) @@ -5886,7 +5849,8 @@ ada_add_block_symbols (struct obstack *obstackp, for (sym = block_iter_match_first (block, name, wild_match, &iter); sym != NULL; sym = block_iter_match_next (name, wild_match, &iter)) { - if (ada_symbol_matches_domain (SYMBOL_DOMAIN (sym), domain) + if (symbol_matches_domain (SYMBOL_LANGUAGE (sym), + SYMBOL_DOMAIN (sym), domain) && wild_match (SYMBOL_LINKAGE_NAME (sym), name) == 0) { if (SYMBOL_CLASS (sym) == LOC_UNRESOLVED) @@ -5908,7 +5872,8 @@ ada_add_block_symbols (struct obstack *obstackp, for (sym = block_iter_match_first (block, name, full_match, &iter); sym != NULL; sym = block_iter_match_next (name, full_match, &iter)) { - if (ada_symbol_matches_domain (SYMBOL_DOMAIN (sym), domain)) + if (symbol_matches_domain (SYMBOL_LANGUAGE (sym), + SYMBOL_DOMAIN (sym), domain)) { if (SYMBOL_CLASS (sym) != LOC_UNRESOLVED) { @@ -5940,7 +5905,8 @@ ada_add_block_symbols (struct obstack *obstackp, ALL_BLOCK_SYMBOLS (block, iter, sym) { - if (ada_symbol_matches_domain (SYMBOL_DOMAIN (sym), domain)) + if (symbol_matches_domain (SYMBOL_LANGUAGE (sym), + SYMBOL_DOMAIN (sym), domain)) { int cmp; @@ -7528,12 +7494,11 @@ ada_find_any_type_symbol (const char *name) struct symbol *sym; sym = standard_lookup (name, get_selected_block (NULL), VAR_DOMAIN); - if (sym != NULL - && (SYMBOL_DOMAIN (sym) != VAR_DOMAIN - || SYMBOL_CLASS (sym) == LOC_TYPEDEF)) + if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF) return sym; - return NULL; + sym = standard_lookup (name, NULL, STRUCT_DOMAIN); + return sym; } /* Find a type named NAME. Ignores ambiguity. This routine will look |