diff options
author | Joel Brobecker <brobecker@gnat.com> | 2012-02-29 19:51:49 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2012-02-29 19:51:49 +0000 |
commit | 739593e0ec988c02057a16da872b32faa992f657 (patch) | |
tree | 5cafa6dbe4e8ad7966769dcd2a63cc7189952078 /gdb/ada-exp.y | |
parent | 852dff6c6724a3a578e9aad70c2185f7f279782f (diff) | |
download | gdb-739593e0ec988c02057a16da872b32faa992f657.zip gdb-739593e0ec988c02057a16da872b32faa992f657.tar.gz gdb-739593e0ec988c02057a16da872b32faa992f657.tar.bz2 |
ada-lang.c:ada_find_renaming_symbol minor improvement.
This is a minor improvement in ada_find_renaming_symbol: What we were
doing was going from a symbol, get its name, and then search for
renamings. But if the original symbol was already itself a renaming,
then we'd look the symbol up again to return it. Since we had the
symbol in the first place, we shouldn't need to look it up again.
This is what this patch does: Modify ada_find_renaming_symbol to
take a symbol instead of the symbol's (linkage) name, and then updates
the one caller.
gdb/ChangeLog:
* 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.
* ada-lang.c (ada_find_renaming_symbol): Replace parameter
"name" with "struct symbol *name_sym". Adjust Implementation
accordingly. Adjust the function documentation.
Diffstat (limited to 'gdb/ada-exp.y')
-rw-r--r-- | gdb/ada-exp.y | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index d1c7367..226cc1d 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -1288,8 +1288,7 @@ write_var_or_type (struct block *block, struct stoken name0) 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; |