* linespec.c: Include language.h.

(find_methods): Add language parameter.  Call
	lookup_symbol_in_language.  Pass language down.
	(add_matching_methods): Likewise.  Call
	lookup_symbol_in_language.
	(add_constructors): Likewise.
	(find_method): Pass sym_class to collect_methods.
	(collect_methods): Add sym_class parameter.  Pass language
	down.
	* symtab.c (lookup_symbol): Rename to ...
	(lookup_symbol_in_language): ... this.  Add language
	parameter.  Use passed language instead of current_language.
	(lookup_symbol): New as wrapper around
	lookup_symbol_in_language.
	(lookup_symbol_aux): Add language parameter.  Use passed
	language instead of current_language.
	(search_symbols): Indent.
	* symtab.h (enum language): Forward declare.
	(lookup_symbol_in_language): Declare.
	(lookup_symbol): Update description.
	* ada-lang.h (lookup_symbol_in_language): Remove declaration.
	* ada-lang.c (restore_language): Remove.
	(lookup_symbol_in_language): Remove.
This commit is contained in:
Pedro Alves
2007-03-28 00:12:15 +00:00
parent 513766ac8b
commit 53c5240fe1
6 changed files with 99 additions and 69 deletions

View File

@@ -4213,31 +4213,6 @@ add_symbols_from_enclosing_procs (struct obstack *obstackp,
{
}
/* FIXME: The next two routines belong in symtab.c */
static void
restore_language (void *lang)
{
set_language ((enum language) lang);
}
/* As for lookup_symbol, but performed as if the current language
were LANG. */
struct symbol *
lookup_symbol_in_language (const char *name, const struct block *block,
domain_enum domain, enum language lang,
int *is_a_field_of_this, struct symtab **symtab)
{
struct cleanup *old_chain
= make_cleanup (restore_language, (void *) current_language->la_language);
struct symbol *result;
set_language (lang);
result = lookup_symbol (name, block, domain, is_a_field_of_this, symtab);
do_cleanups (old_chain);
return result;
}
/* True if TYPE is definitely an artificial type supplied to a symbol
for which no debugging information was given in the symbol file. */