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/cp-namespace.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/cp-namespace.c')
-rw-r--r-- | gdb/cp-namespace.c | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index ae7c852..cd57399 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -221,12 +221,7 @@ cp_is_anonymous (const char *namespace) we're looking for, BLOCK is the block that we're searching within, DOMAIN says what kind of symbols we're looking for, and if SYMTAB is non-NULL, we should store the symtab where we found the symbol - in it. - - Class, union, and enum tag names may be used in C++ without specifying - class-key or enum. If searching for a VAR_DOMAIN symbol fails, - this function will search STRUCT_DOMAIN. [This is actually done in - cp_lookup_symbol_in_namespace.] */ + in it. */ struct symbol * cp_lookup_symbol_nonlocal (const char *name, @@ -247,10 +242,7 @@ cp_lookup_symbol_nonlocal (const char *name, /* Look up NAME in the C++ namespace NAMESPACE. Other arguments are as in cp_lookup_symbol_nonlocal. If SEARCH is non-zero, search - through base classes for a matching symbol. - - If DOMAIN is VAR_DOMAIN and no matching symbol exists in that domain, - this function will search STRUCT_DOMAIN for a match. */ + through base classes for a matching symbol. */ static struct symbol * cp_lookup_symbol_in_namespace (const char *namespace, @@ -260,30 +252,18 @@ cp_lookup_symbol_in_namespace (const char *namespace, { if (namespace[0] == '\0') { - struct symbol *sym = lookup_symbol_file (name, block, domain, 0, search); - - if (sym == NULL && domain == VAR_DOMAIN) - sym = lookup_symbol_file (name, block, STRUCT_DOMAIN, 0, search); - - return sym; + return lookup_symbol_file (name, block, domain, 0, search); } else { - struct symbol *sym; char *concatenated_name = alloca (strlen (namespace) + 2 + strlen (name) + 1); strcpy (concatenated_name, namespace); strcat (concatenated_name, "::"); strcat (concatenated_name, name); - sym = lookup_symbol_file (concatenated_name, block, domain, - cp_is_anonymous (namespace), search); - - if (sym == NULL && domain == VAR_DOMAIN) - sym = lookup_symbol_file (concatenated_name, block, STRUCT_DOMAIN, - cp_is_anonymous (namespace), search); - - return sym; + return lookup_symbol_file (concatenated_name, block, domain, + cp_is_anonymous (namespace), search); } } @@ -536,12 +516,7 @@ cp_lookup_symbol_imports_or_template (const char *scope, /* Searches for NAME in the current namespace, and by applying relevant import statements belonging to BLOCK and its parents. SCOPE is the namespace scope of the context in which the search is - being evaluated. - - Class, union, and enum tag names may be used in C++ without specifying - class-key or enum. If searching for a VAR_DOMAIN symbol fails, - this function will search STRUCT_DOMAIN. [This is done in - cp_lookup_symbol_in_namespace.] */ + being evaluated. */ struct symbol* cp_lookup_symbol_namespace (const char *scope, @@ -718,7 +693,7 @@ lookup_symbol_file (const char *name, /* Lookup a class named KLASS. If none is found, there is nothing more that can be done. */ - klass_sym = lookup_symbol_global (klass, block, STRUCT_DOMAIN); + klass_sym = lookup_symbol_global (klass, block, domain); if (klass_sym == NULL) { do_cleanups (cleanup); |