From c6e5ee5efa5cfda9531dd64d13dbe645ad2ab84c Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Sat, 2 Jun 2012 04:34:23 +0000 Subject: 2012-06-02 Sergio Durigan Junior * symtab.c (symbol_demangled_name): New variable `dem_name'. Use it to optimize resolution of demangled name. --- gdb/symtab.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gdb/symtab.c') diff --git a/gdb/symtab.c b/gdb/symtab.c index 85ddd1d..5eb7ced 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -850,6 +850,8 @@ symbol_natural_name (const struct general_symbol_info *gsymbol) const char * symbol_demangled_name (const struct general_symbol_info *gsymbol) { + const char *dem_name = NULL; + switch (gsymbol->language) { case language_cplus: @@ -858,19 +860,17 @@ symbol_demangled_name (const struct general_symbol_info *gsymbol) case language_java: case language_objc: case language_fortran: - if (symbol_get_demangled_name (gsymbol) != NULL) - return symbol_get_demangled_name (gsymbol); + dem_name = symbol_get_demangled_name (gsymbol); break; case language_ada: - if (symbol_get_demangled_name (gsymbol) != NULL) - return symbol_get_demangled_name (gsymbol); - else - return ada_decode_symbol (gsymbol); + dem_name = symbol_get_demangled_name (gsymbol); + if (dem_name == NULL) + dem_name = ada_decode_symbol (gsymbol); break; default: break; } - return NULL; + return dem_name; } /* Return the search name of a symbol---generally the demangled or -- cgit v1.1