2012-02-29 Joel Brobecker <brobecker@adacore.com>
+ * ada-lang.h (ada_find_renaming_symbol): Replace parameter
+ "name" with "struct symbol *name_sym".
+ * ada-exp.y (write_var_or_type): Update call to
+ ada_find_renaming_symbol.
+ "name" with "struct symbol *name_sym". Adjust Implementation
+ accordingly. Adjust the function documentation.
+
+2012-02-29 Joel Brobecker <brobecker@adacore.com>
+
* ada-lang.h (ada_find_any_symbol, ada_find_any_type): Delete.
* ada-lang.c (ada_find_any_type): Add advance declaration.
Make static. Replace ada_find_any_symbol by
if (nsyms == 1)
{
struct symbol *ren_sym =
- ada_find_renaming_symbol (SYMBOL_LINKAGE_NAME (syms[0].sym),
- syms[0].block);
+ ada_find_renaming_symbol (syms[0].sym, syms[0].block);
if (ren_sym != NULL)
syms[0].sym = ren_sym;
return NULL;
}
-/* Given NAME and an associated BLOCK, search all symbols for
- NAME suffixed with "___XR", which is the ``renaming'' symbol
- associated to NAME. Return this symbol if found, return
- NULL otherwise. */
+/* Given NAME_SYM and an associated BLOCK, find a "renaming" symbol
+ associated with NAME_SYM's name. NAME_SYM may itself be a renaming
+ symbol, in which case it is returned. Otherwise, this looks for
+ symbols whose name is that of NAME_SYM suffixed with "___XR".
+ Return symbol if found, and NULL otherwise. */
struct symbol *
-ada_find_renaming_symbol (const char *name, struct block *block)
+ada_find_renaming_symbol (struct symbol *name_sym, struct block *block)
{
+ const char *name = SYMBOL_LINKAGE_NAME (name_sym);
struct symbol *sym;
+ if (strstr (name, "___XR") != NULL)
+ return name_sym;
+
sym = find_old_style_renaming_symbol (name, block);
if (sym != NULL)
extern LONGEST get_int_var_value (char *, int *);
-extern struct symbol *ada_find_renaming_symbol (const char *name,
+extern struct symbol *ada_find_renaming_symbol (struct symbol *name_sym,
struct block *block);
extern int ada_prefer_type (struct type *, struct type *);