diff options
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index 345c20d..a52f7c0 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -473,40 +473,15 @@ gdb_mangle_name (struct type *type, int method_id, int signature_id) return (mangled_name); } -/* Initialize the cplus_specific structure. 'cplus_specific' should - only be allocated for use with cplus symbols. */ - -static void -symbol_init_cplus_specific (struct general_symbol_info *gsymbol, - struct obstack *obstack) -{ - /* A language_specific structure should not have been previously - initialized. */ - gdb_assert (gsymbol->language_specific.cplus_specific == NULL); - gdb_assert (obstack != NULL); - - gsymbol->language_specific.cplus_specific = - OBSTACK_ZALLOC (obstack, struct cplus_specific); -} - /* Set the demangled name of GSYMBOL to NAME. NAME must be already - correctly allocated. For C++ symbols a cplus_specific struct is - allocated so OBJFILE must not be NULL. If this is a non C++ symbol - OBJFILE can be NULL. */ + correctly allocated. */ void symbol_set_demangled_name (struct general_symbol_info *gsymbol, const char *name, struct obstack *obstack) { - if (gsymbol->language == language_cplus) - { - if (gsymbol->language_specific.cplus_specific == NULL) - symbol_init_cplus_specific (gsymbol, obstack); - - gsymbol->language_specific.cplus_specific->demangled_name = name; - } - else if (gsymbol->language == language_ada) + if (gsymbol->language == language_ada) { if (name == NULL) { @@ -528,14 +503,7 @@ symbol_set_demangled_name (struct general_symbol_info *gsymbol, const char * symbol_get_demangled_name (const struct general_symbol_info *gsymbol) { - if (gsymbol->language == language_cplus) - { - if (gsymbol->language_specific.cplus_specific != NULL) - return gsymbol->language_specific.cplus_specific->demangled_name; - else - return NULL; - } - else if (gsymbol->language == language_ada) + if (gsymbol->language == language_ada) { if (!gsymbol->ada_mangled) return NULL; @@ -555,7 +523,8 @@ symbol_set_language (struct general_symbol_info *gsymbol, struct obstack *obstack) { gsymbol->language = language; - if (gsymbol->language == language_d + if (gsymbol->language == language_cplus + || gsymbol->language == language_d || gsymbol->language == language_go || gsymbol->language == language_java || gsymbol->language == language_objc @@ -568,8 +537,6 @@ symbol_set_language (struct general_symbol_info *gsymbol, gdb_assert (gsymbol->ada_mangled == 0); gsymbol->language_specific.obstack = obstack; } - else if (gsymbol->language == language_cplus) - gsymbol->language_specific.cplus_specific = NULL; else { memset (&gsymbol->language_specific, 0, |